Class ConsingIterator<A>

  • All Implemented Interfaces:
    java.util.Iterator<A>

    public final class ConsingIterator<A>
    extends java.lang.Object
    implements java.util.Iterator<A>
    • Constructor Summary

      Constructors 
      Constructor Description
      ConsingIterator​(A head, java.lang.Iterable<A> as)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      A 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

      • head

        private final A head
      • asSupplier

        private final Fn0<java.util.Iterator<A>> asSupplier
      • asIterator

        private java.util.Iterator<A> asIterator
      • iteratedHead

        private boolean iteratedHead
    • Constructor Detail

      • ConsingIterator

        public ConsingIterator​(A head,
                               java.lang.Iterable<A> as)
    • Method Detail

      • hasNext

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

        public A next()
        Specified by:
        next in interface java.util.Iterator<A>