com.jgpruitt.datamodeler.util
Class ReadOnlyIterator<E>

java.lang.Object
  extended by com.jgpruitt.datamodeler.util.ReadOnlyIterator<E>
Type Parameters:
E - the Type of objects being iterated over
All Implemented Interfaces:
java.util.Iterator<E>

public class ReadOnlyIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>

Generic Iterator that does not implement the remove operation rendering it read-only. The class wraps another instance of Iterator.


Constructor Summary
ReadOnlyIterator(java.util.Iterator<E> iterator)
          Constructor.
 
Method Summary
 boolean hasNext()
           
 E next()
           
 void remove()
          Unsupported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlyIterator

public ReadOnlyIterator(java.util.Iterator<E> iterator)
Constructor.

Parameters:
iterator - the Iterator to be wrapped
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()
Unsupported.

Specified by:
remove in interface java.util.Iterator<E>