Class UnmodifiableDeque.UnmodifiableIterator

  • All Implemented Interfaces:
    Iterator<T>
    Enclosing class:
    UnmodifiableDeque<T>

    @ThreadSafe
    private class UnmodifiableDeque.UnmodifiableIterator
    extends Object
    implements Iterator<T>
    Provides an Iterator implementation that cannot be used to modify the underlying Collection.
    Since:
    2.1.4
    Version:
    $Id: UnmodifiableDeque.java 16154 2012-07-14 16:34:05Z colin $
    Author:
    Colin DuPlantis
    • Field Detail

      • iterator

        private final Iterator<T> iterator
        underlying iterator used to track the cursor location
    • Constructor Detail

      • UnmodifiableIterator

        private UnmodifiableIterator​(Deque<T> inCollection,
                                     boolean inIsDescending)
        Create a new UnmodifiableIterator instance.
        Parameters:
        inCollection - a Deque<T> value
        inIsDescending - a boolean value indicating if the iterator should be ascending or descending
    • Method Detail

      • hasNext

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

        public T next()
        Specified by:
        next in interface Iterator<T>
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator<T>