Package org.apache.cassandra.dht
Class Range.OrderedRangeContainmentChecker
- java.lang.Object
-
- org.apache.cassandra.dht.Range.OrderedRangeContainmentChecker
-
- All Implemented Interfaces:
java.util.function.Predicate<Token>
- Enclosing class:
- Range<T extends RingPosition<T>>
public static class Range.OrderedRangeContainmentChecker extends java.lang.Object implements java.util.function.Predicate<Token>
Helper class to check if a token is contained within a given collection of ranges
-
-
Constructor Summary
Constructors Constructor Description OrderedRangeContainmentChecker(java.util.Collection<Range<Token>> ranges)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
test(Token t)
Returns true if the ranges given in the constructor contains the token, false otherwise.
-
-
-
Method Detail
-
test
public boolean test(Token t)
Returns true if the ranges given in the constructor contains the token, false otherwise. The tokens passed to this method must be in increasing order- Specified by:
test
in interfacejava.util.function.Predicate<Token>
- Parameters:
t
- token to check, must be larger than or equal to the last token passed- Returns:
- true if the token is contained within the ranges given to the constructor.
-
-