Class Util.FilteringIterator<T>

  • Type Parameters:
    T - Element type
    All Implemented Interfaces:
    Enclosing class:

    private static class Util.FilteringIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<T>
    Iterator that applies a predicate to each element.
    • Field Summary

      Modifier and Type Field Description
      (package private) T current  
      private static java.lang.Object DUMMY  
      (package private) java.util.Iterator<? extends T> iterator  
      private java.util.function.Predicate<T> predicate  
    • Constructor Summary

      Constructor Description
      FilteringIterator​(java.util.Iterator<? extends T> iterator, java.util.function.Predicate<T> predicate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      protected T moveNext()  
      T next()  
      • Methods inherited from class java.lang.Object

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

        forEachRemaining, remove
    • Field Detail

      • DUMMY

        private static final java.lang.Object DUMMY
      • iterator

        final java.util.Iterator<? extends T> iterator
      • predicate

        private final java.util.function.Predicate<T> predicate
      • current

        T current
    • Constructor Detail

      • FilteringIterator

        FilteringIterator​(java.util.Iterator<? extends T> iterator,
                          java.util.function.Predicate<T> predicate)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<T>
      • next

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
      • moveNext

        protected T moveNext()