Class ImmutableIterator<E>

  • All Implemented Interfaces:
    java.util.Iterator<E>
    Direct Known Subclasses:
    ImmutableListIterator

    class ImmutableIterator<E>
    extends java.lang.Object
    implements java.util.Iterator<E>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.Object[] elements  
      (package private) int index  
    • Constructor Summary

      Constructors 
      Constructor Description
      ImmutableIterator​(java.lang.Object[] elements)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void forEachRemaining​(java.util.function.Consumer<? super E> action)  
      boolean hasNext()  
      E next()  
      void remove()  
      • Methods inherited from class java.lang.Object

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

      • elements

        final java.lang.Object[] elements
      • index

        int index
    • Constructor Detail

      • ImmutableIterator

        ImmutableIterator​(java.lang.Object[] elements)
    • Method Detail

      • hasNext

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

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

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<E>
      • forEachRemaining

        public void forEachRemaining​(java.util.function.Consumer<? super E> action)
        Specified by:
        forEachRemaining in interface java.util.Iterator<E>