org.ws4d.java.structures
Class ReadOnlyIterator

java.lang.Object
  extended by org.ws4d.java.structures.ReadOnlyIterator
All Implemented Interfaces:
Iterator

public class ReadOnlyIterator
extends java.lang.Object
implements Iterator

An iterator over a data structure.


Constructor Summary
ReadOnlyIterator(DataStructure dataStructure)
          Constructor, wraps the iterator of the given data structure.
ReadOnlyIterator(Iterator it)
          Constructor, wraps iterator.
 
Method Summary
 boolean hasNext()
          Returns true if the iteration has more elements.
 java.lang.Object next()
          Returns the next element in the iteration.
 void remove()
          Operation is unsupported by ReadOnlyIterator, throws UnsupportedOperationException.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlyIterator

public ReadOnlyIterator(DataStructure dataStructure)
Constructor, wraps the iterator of the given data structure.

Parameters:
dataStructure - the data structure to wrap

ReadOnlyIterator

public ReadOnlyIterator(Iterator it)
Constructor, wraps iterator.

Parameters:
it - iterator to wrap
Method Detail

hasNext

public boolean hasNext()
Description copied from interface: Iterator
Returns true if the iteration has more elements.

Specified by:
hasNext in interface Iterator
Returns:
true if the iterator has more elements.

next

public java.lang.Object next()
Description copied from interface: Iterator
Returns the next element in the iteration.

Specified by:
next in interface Iterator
Returns:
the next element in the iteration.

remove

public void remove()
Operation is unsupported by ReadOnlyIterator, throws UnsupportedOperationException.

Specified by:
remove in interface Iterator