Class Limit

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int current
      The current number of times the predicate has been invoked.
      private int max
      The max number of times the predicate can be invoked.
    • Constructor Summary

      Constructors 
      Constructor Description
      Limit​(int count)
      Create a new Limit.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean test()
      Evaluate this predicate.
      boolean test​(java.lang.Object obj)
      Evaluate this predicate.
      boolean test​(java.lang.Object a, java.lang.Object b)
      Evaluate this predicate.
      java.lang.String toString()
      Returns a human readable description of this functor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • max

        private final int max
        The max number of times the predicate can be invoked.
      • current

        private int current
        The current number of times the predicate has been invoked.
    • Constructor Detail

      • Limit

        public Limit​(int count)
        Create a new Limit.
        Parameters:
        count - limit
    • Method Detail

      • test

        public boolean test()
        Evaluate this predicate.
        Specified by:
        test in interface Predicate
        Returns:
        the result of this test
      • test

        public boolean test​(java.lang.Object obj)
        Evaluate this predicate.
        Specified by:
        test in interface UnaryPredicate<java.lang.Object>
        Parameters:
        obj - the A object to test
        Returns:
        the result of this test
      • test

        public boolean test​(java.lang.Object a,
                            java.lang.Object b)
        Evaluate this predicate.
        Specified by:
        test in interface BinaryPredicate<java.lang.Object,​java.lang.Object>
        Parameters:
        a - the L element of the ordered pair of arguments
        b - the R element of the ordered pair of arguments
        Returns:
        the result of this test for the given arguments
      • toString

        public java.lang.String toString()
        Returns a human readable description of this functor. Implementators are strongly encouraged but not strictly required to override the default Object implementation of this method.
        Specified by:
        toString in interface Functor
        Overrides:
        toString in class java.lang.Object
        Returns:
        a human readable description of this functor