Class Range.OrderedRangeContainmentChecker

java.lang.Object
org.apache.cassandra.dht.Range.OrderedRangeContainmentChecker
All Implemented Interfaces:
Predicate<Token>
Enclosing class:
Range<T extends RingPosition<T>>

public static class Range.OrderedRangeContainmentChecker extends Object implements Predicate<Token>
Helper class to check if a token is contained within a given collection of ranges
  • Constructor Details

    • OrderedRangeContainmentChecker

      public OrderedRangeContainmentChecker(Collection<Range<Token>> ranges)
  • Method Details

    • 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 interface 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.