org.jfree.util
Class ReadOnlyIterator
java.lang.Object
org.jfree.util.ReadOnlyIterator
- Iterator
extends java.lang.Object
implements Iterator
Protects an given iterator by preventing calls to remove().
ReadOnlyIterator(Iterator it) - Creates a new read-only iterator for the given iterator.
|
boolean | hasNext() - Returns true if the iteration has more elements.
|
Object | next() - Returns the next element in the iteration.
|
void | remove() - Throws
UnsupportedOperationException .
|
ReadOnlyIterator
public ReadOnlyIterator(Iterator it)
Creates a new read-only iterator for the given iterator.
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.)
- true if the iterator has more elements.
next
public Object next()
Returns the next element in the iteration.
Throws NoSuchElementException when iteration has no more elements.
- the next element in the iteration.
remove
public void remove()
Throws UnsupportedOperationException
.