Class IntSetPredicate

  • All Implemented Interfaces:
    IntPredicate

    public class IntSetPredicate
    extends Object
    implements IntPredicate
    An implementation of IntPredicate that tests whether a given integer is a member of some IntSet
    • Field Detail

      • ALWAYS_TRUE

        public static final IntPredicate ALWAYS_TRUE
        Convenience predicate that always matches
      • ALWAYS_FALSE

        public static final IntPredicate ALWAYS_FALSE
        Convenience predicate that never matches
    • Constructor Detail

      • IntSetPredicate

        public IntSetPredicate​(IntSet set)
    • Method Detail

      • test

        public boolean test​(int value)
        Ask whether a given value matches this predicate
        Specified by:
        test in interface IntPredicate
        Parameters:
        value - the value to be tested
        Returns:
        true if the value matches; false if it does not
      • or

        public IntPredicate or​(IntPredicate other)
        Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another. When evaluating the composed predicate, if this predicate is true, then the other predicate is not evaluated.

        Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this predicate throws an exception, the other predicate will not be evaluated.

        Specified by:
        or in interface IntPredicate
        Parameters:
        other - a predicate that will be logically-ORed with this predicate
        Returns:
        a composed predicate that represents the short-circuiting logical OR of this predicate and the other predicate
        Throws:
        NullPointerException - if other is null
      • getIntSet

        public IntSet getIntSet()
        Get the underlying IntSet
        Returns:
        the underlying IntSet
      • toString

        public String toString()
        Get string representation
        Overrides:
        toString in class Object