Class IndexOfInGenerator.IndexProcedure<T>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long current
      A local accumulator to increment the number of attempts.
      private Generator<? extends T> generator
      The wrapped generator.
      private long index
      The number of iterations needed before the wrapped predicate found the target, -1 means the target was not found.
      private UnaryPredicate<? super T> pred
      The wrapped predicate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run​(T obj)
      Execute this procedure.
      • Methods inherited from class java.lang.Object

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

      • generator

        private final Generator<? extends T> generator
        The wrapped generator.
      • pred

        private final UnaryPredicate<? super T> pred
        The wrapped predicate.
      • index

        private long index
        The number of iterations needed before the wrapped predicate found the target, -1 means the target was not found.
      • current

        private long current
        A local accumulator to increment the number of attempts.
    • Constructor Detail

      • IndexProcedure

        IndexProcedure​(Generator<? extends T> generator,
                       UnaryPredicate<? super T> pred)
        Create a new IndexProcedure.
        Parameters:
        generator - The wrapped generator
        pred - The wrapped predicate
    • Method Detail

      • run

        public void run​(T obj)
        Execute this procedure.
        Specified by:
        run in interface UnaryProcedure<T>
        Parameters:
        obj - an A parameter to this execution