Package org.jfree.util
Class ReadOnlyIterator
java.lang.Object
org.jfree.util.ReadOnlyIterator
- All Implemented Interfaces:
Iterator
Protects an given iterator by preventing calls to remove().
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new read-only iterator for the given iterator. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
base
The base iterator which we protect.
-
-
Constructor Details
-
ReadOnlyIterator
Creates a new read-only iterator for the given iterator.- Parameters:
it
- the iterator.
-
-
Method Details
-
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.) -
next
Returns the next element in the iteration. Throws NoSuchElementException when iteration has no more elements. -
remove
public void remove()ThrowsUnsupportedOperationException
.
-