Class FilteredIt<O>

  • Type Parameters:
    O - Object type
    All Implemented Interfaces:
    It<O>, Iter

    public class FilteredIt<O>
    extends java.lang.Object
    implements It<O>
    Filtered iterator.
    Since:
    0.7.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) O current
      Current object, if valid.
      (package private) java.util.function.Predicate<? super O> filter
      Class filter.
      private It<O> it
      Iterator in primary hierarchy.
    • Constructor Summary

      Constructors 
      Constructor Description
      FilteredIt​(It<O> it, java.util.function.Predicate<? super O> clazz)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FilteredIt<O> advance()
      Moves the iterator forward to the next entry.
      O get()
      Access the current object.
      boolean valid()
      Returns true if the iterator currently points to a valid object.
      • Methods inherited from class java.lang.Object

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

      • filter

        java.util.function.Predicate<? super O> filter
        Class filter.
      • current

        O current
        Current object, if valid.
      • it

        private It<O> it
        Iterator in primary hierarchy.
    • Constructor Detail

      • FilteredIt

        public FilteredIt​(It<O> it,
                          java.util.function.Predicate<? super O> clazz)
        Constructor.
        Parameters:
        it - Iterator in primary hierarchy
        clazz - Class filter
    • Method Detail

      • get

        public O get()
        Description copied from interface: It
        Access the current object.
        Specified by:
        get in interface It<O>
        Returns:
        Current object
      • valid

        public boolean valid()
        Description copied from interface: Iter
        Returns true if the iterator currently points to a valid object.
        Specified by:
        valid in interface Iter
        Returns:
        a boolean value, whether the position is valid.
      • advance

        public FilteredIt<O> advance()
        Description copied from interface: Iter
        Moves the iterator forward to the next entry.
        Specified by:
        advance in interface It<O>
        Specified by:
        advance in interface Iter
        Returns:
        The iterator itself.