Class LayerManager.Cleanup
java.lang.Object
org.apache.commons.collections4.bloomfilter.LayerManager.Cleanup
- Enclosing class:
- LayerManager
Static methods to create a Consumer of a LinkedList of BloomFilter perform
tests on whether to reduce the collection of Bloom filters.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Consumer<LinkedList<BloomFilter>>
A Cleanup that never removes anything.static Consumer<LinkedList<BloomFilter>>
onMaxSize
(int maxSize) Removes the earliest filters in the list when the the number of filters exceeds maxSize.static Consumer<LinkedList<BloomFilter>>
Removes the last added target if it is empty.
-
Method Details
-
noCleanup
A Cleanup that never removes anything.- Returns:
- A Consumer suitable for the LayerManager
cleanup
parameter.
-
onMaxSize
Removes the earliest filters in the list when the the number of filters exceeds maxSize.- Parameters:
maxSize
- the maximum number of filters for the list. Must be greater than 0- Returns:
- A Consumer suitable for the LayerManager
cleanup
parameter. - Throws:
IllegalArgumentException
- ifmaxSize <= 0
.
-
removeEmptyTarget
Removes the last added target if it is empty. Useful as the first in a chain of cleanup consumers. (e.g.Cleanup.removeEmptyTarget.andThen( otherConsumer )
)- Returns:
- A Consumer suitable for the LayerManager
cleanup
parameter.
-