Class LayerManager.Cleanup
java.lang.Object
org.apache.commons.collections4.bloomfilter.LayerManager.Cleanup
- Enclosing class:
- LayerManager<T extends BloomFilter<T>>
Static methods to create a Consumer of a List of BloomFilter perform
 tests on whether to reduce the collection of Bloom filters.
- Since:
- 4.5.0-M1
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T extends BloomFilter<T>>
 Consumer<Deque<T>> A Cleanup that never removes anything.static <T extends BloomFilter<T>>
 Consumer<Deque<T>> onMaxSize(int maxSize) Removes the earliest filters in the list when the the number of filters exceeds maxSize.static <T extends BloomFilter<T>>
 Consumer<Deque<T>> Removes the last added target if it is empty.static <T extends BloomFilter<T>>
 Consumer<Deque<T>> Removes any layer identified by the predicate.
- 
Method Details- 
noCleanupA Cleanup that never removes anything.- Type Parameters:
- T- Type of BloomFilter.
- Returns:
- A Consumer suitable for the LayerManager cleanupparameter.
 
- 
onMaxSizeRemoves the earliest filters in the list when the the number of filters exceeds maxSize.- Type Parameters:
- T- Type of BloomFilter.
- Parameters:
- maxSize- the maximum number of filters for the list. Must be greater than 0
- Returns:
- A Consumer suitable for the LayerManager cleanupparameter.
- Throws:
- IllegalArgumentException- if- maxSize <= 0.
 
- 
removeEmptyTargetRemoves the last added target if it is empty. Useful as the first in a chain of cleanup consumers. (for exampleCleanup.removeEmptyTarget.andThen( otherConsumer ))- Type Parameters:
- T- Type of BloomFilter.
- Returns:
- A Consumer suitable for the LayerManager cleanupparameter.
 
- 
removeIfRemoves any layer identified by the predicate.- Type Parameters:
- T- Type of BloomFilter.
- Parameters:
- test- Predicate.
- Returns:
- A Consumer suitable for the LayerManager cleanupparameter.
 
 
-