org.enhydra.xml.xmlc.misc
Class ReadIterator

java.lang.Object
  |
  +--org.enhydra.xml.xmlc.misc.ReadIterator
All Implemented Interfaces:
Iterator

public class ReadIterator
extends Object
implements Iterator

Wrapper around Iterator objects that doesn't allow modification.


Constructor Summary
ReadIterator(Iterator iter)
          Constructor.
 
Method Summary
 boolean hasNext()
          Returns true if the iteration has more elements.
 Object next()
          Returns the next element in the interation.
 void remove()
          Throws an exception, preventing modification of the underlying structure.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadIterator

public ReadIterator(Iterator iter)
Constructor.
Parameters:
iter - Iterator to wrap.
Method Detail

hasNext

public boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception).
Specified by:
hasNext in interface Iterator
Returns:
true if the iterator has more elements.
See Also:
Iterator.hasNext()

next

public Object next()
Returns the next element in the interation.
Specified by:
next in interface Iterator
Throws:
NoSuchElementException - iteration has no more elements.

remove

public void remove()
Throws an exception, preventing modification of the underlying structure.
Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException - Always thrown.


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.