SingletonIterator is an java.util.ListIterator over a single
object instance.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean | |
| private E | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | SingletonListIterator(final E
the single object to return from the iterator object)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(final E
the object to add obj)Implements java. UnsupportedOperationException.
|
| public boolean | Returns: true if the single object hasn't been returned yetImplements java. |
| public boolean | Returns: true if the single object has been returnedImplements java. |
| public E | Returns: the single objectImplements java. |
| public int | Returns: 0 or 1 depending on current state.Implements java. next.
|
| public E | Returns: the single objectImplements java. |
| public int | Returns: 0 or -1 depending on current state.Implements java. previous.
|
| public void | remove()
Overrides default java. Implements java. |
| public void | reset()
Implements org. |
| public void | set(final E
the object to set obj)Implements java. |
| beforeFirst | back to summary |
|---|---|
| private boolean beforeFirst | |
| nextCalled | back to summary |
|---|---|
| private boolean nextCalled | |
| object | back to summary |
|---|---|
| private E object | |
| removed | back to summary |
|---|---|
| private boolean removed | |
| SingletonListIterator | back to summary |
|---|---|
| public SingletonListIterator(final E object) Constructs a new
| |
| add | back to summary |
|---|---|
| public void add(final E obj) Implements java. Add always throws
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Is another object available from the iterator? This returns true if the single object hasn't been returned yet.
| |
| hasPrevious | back to summary |
|---|---|
| public boolean hasPrevious() Implements java. Is a previous object available from the iterator? This returns true if the single object has been returned.
| |
| next | back to summary |
|---|---|
| public E next() Implements java. Get the next object from the iterator. This returns the single object if it hasn't been returned yet.
| |
| nextIndex | back to summary |
|---|---|
| public int nextIndex() Implements java. Returns the index of the element that would be returned by a subsequent
call to
| |
| previous | back to summary |
|---|---|
| public E previous() Implements java. Get the previous object from the iterator. This returns the single object if it has been returned.
| |
| previousIndex | back to summary |
|---|---|
| public int previousIndex() Implements java. Returns the index of the element that would be returned by a subsequent
call to
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Implements java. Remove the object from this iterator.
| |
| reset | back to summary |
|---|---|
| public void reset() Implements org. Reset the iterator back to the start.
| |
| set | back to summary |
|---|---|
| public void set(final E obj) Implements java. Set sets the value of the singleton.
| |