Class LayerManager.ExtendCheck
- java.lang.Object
-
- org.apache.commons.collections4.bloomfilter.LayerManager.ExtendCheck
-
- Enclosing class:
- LayerManager<T extends BloomFilter<T>>
public static final class LayerManager.ExtendCheck extends java.lang.Object
A collection of common ExtendCheck implementations to test whether to extend the depth of a LayerManager.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends BloomFilter<T>>
java.util.function.Predicate<LayerManager<T>>advanceOnCount(int breakAt)Creates a new target after a specific number of filters have been added to the current target.static <T extends BloomFilter<T>>
java.util.function.Predicate<LayerManager<T>>advanceOnPopulated()Advances the target once a merge has been performed.static <T extends BloomFilter<T>>
java.util.function.Predicate<LayerManager<T>>advanceOnSaturation(double maxN)Creates a new target after the current target is saturated.static <T extends BloomFilter<T>>
java.util.function.Predicate<LayerManager<T>>neverAdvance()Does not automatically advance the target.
-
-
-
Method Detail
-
advanceOnCount
public static <T extends BloomFilter<T>> java.util.function.Predicate<LayerManager<T>> advanceOnCount(int breakAt)
Creates a new target after a specific number of filters have been added to the current target.- Type Parameters:
T- Type of BloomFilter.- Parameters:
breakAt- the number of filters to merge into each filter in the list.- Returns:
- A Predicate suitable for the LayerManager
extendCheckparameter. - Throws:
java.lang.IllegalArgumentException- ifbreakAt <= 0
-
advanceOnPopulated
public static <T extends BloomFilter<T>> java.util.function.Predicate<LayerManager<T>> advanceOnPopulated()
Advances the target once a merge has been performed.- Type Parameters:
T- Type of BloomFilter.- Returns:
- A Predicate suitable for the LayerManager
extendCheckparameter.
-
advanceOnSaturation
public static <T extends BloomFilter<T>> java.util.function.Predicate<LayerManager<T>> advanceOnSaturation(double maxN)
Creates a new target after the current target is saturated. Saturation is defined as theBloom filter estimated N >= maxN.An example usage is advancing on a calculated saturation by calling:
ExtendCheck.advanceOnSaturation(shape.estimateMaxN())- Type Parameters:
T- Type of BloomFilter.- Parameters:
maxN- the maximum number of estimated items in the filter.- Returns:
- A Predicate suitable for the LayerManager
extendCheckparameter. - Throws:
java.lang.IllegalArgumentException- ifmaxN <= 0
-
neverAdvance
public static <T extends BloomFilter<T>> java.util.function.Predicate<LayerManager<T>> neverAdvance()
Does not automatically advance the target. @{code next()} must be called directly to perform the advance.- Type Parameters:
T- Type of BloomFilter.- Returns:
- A Predicate suitable for the LayerManager
extendCheckparameter.
-
-