Class UnmodifiableIterator<T>

  • All Implemented Interfaces:
    Iterator<T>


    public class UnmodifiableIterator<T>
    extends Object
    implements Iterator<T>
    This is an Iterator that throws an UnsupportedOperationException() when remove() is called. This guarantees the underlying iterator won't be modified.
    • Constructor Detail

      • UnmodifiableIterator

        public UnmodifiableIterator(Iterator<T> iter)
    • Method Detail

      • hasNext

        public boolean hasNext()
      • next

        public T next()
      • remove

        public void remove()