E
- the value typeprivate static class KVList.SingletonIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>
Modifier and Type | Field and Description |
---|---|
private boolean |
first
flag whether we are at the first element
|
private E |
value
the value
|
Constructor and Description |
---|
SingletonIterator(E v)
constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
return whether there are more elements
|
E |
next()
return the first element
|
void |
remove()
remove the current element
|
private E value
private boolean first
public SingletonIterator(E v)
v
- the valuepublic boolean hasNext()
hasNext
in interface java.util.Iterator<E>
true
if sopublic E next() throws java.util.NoSuchElementException
next
in interface java.util.Iterator<E>
java.util.NoSuchElementException
- on attempts to read past the endpublic void remove() throws java.lang.UnsupportedOperationException
remove
in interface java.util.Iterator<E>
java.lang.UnsupportedOperationException
- alwaysCopyright © 2005-2013 Knipp Medien und Kommunikation GmbH