public class ReadOnlyIterator
extends java.lang.Object
implements java.util.Iterator
Modifier and Type | Field and Description |
---|---|
private java.util.Iterator |
base
The base iterator which we protect.
|
Constructor and Description |
---|
ReadOnlyIterator(java.util.Iterator it)
Creates a new read-only iterator for the given iterator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Returns true if the iteration has more elements.
|
java.lang.Object |
next()
Returns the next element in the iteration.
|
void |
remove()
Throws
UnsupportedOperationException . |
public ReadOnlyIterator(java.util.Iterator it)
it
- the iterator.public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
public void remove()
UnsupportedOperationException
.remove
in interface java.util.Iterator