Package com.uc4.util

Class NoRemoveIterator<E>

java.lang.Object
com.uc4.util.NoRemoveIterator<E>
Type Parameters:
E - Type
All Implemented Interfaces:
Iterator<E>

public class NoRemoveIterator<E> extends Object implements Iterator<E>
Implementation of the iterator interface. Remove is not supported and will throw an exception
  • Constructor Details

    • NoRemoveIterator

      public NoRemoveIterator(Iterator<E> it)
      Constructs a iterator using the specified iterator. All method call except remove are delegated to the original iterator.
      Parameters:
      it - original iterator
  • Method Details

    • hasNext

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

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

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