Class 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
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Predicate

        and, negate, or
    • Constructor Detail

      • OrderedRangeContainmentChecker

        public OrderedRangeContainmentChecker​(java.util.Collection<Range<Token>> ranges)
    • 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 interface java.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.