SingletonIterator is an java.util.Iterator over a single
object instance.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | beforeFirst
Is the cursor before the first element |
| private E | object
The object |
| private final boolean | removeAllowed
Whether remove is allowed |
| private boolean | removed
Has the element been removed |
| Access | Constructor and Description |
|---|---|
| public | SingletonIterator(final E
the single object to return from the iterator object)Constructs a new |
| public | SingletonIterator(final E
the single object to return from the iterator object, final boolean true if remove is allowed removeAllowed)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the single object hasn't been returned yetImplements java. |
| public E | Returns: the single objectImplements java. |
| public void | |
| public void | reset()
Implements org. |
| beforeFirst | back to summary |
|---|---|
| private boolean beforeFirst Is the cursor before the first element | |
| object | back to summary |
|---|---|
| private E object The object | |
| removeAllowed | back to summary |
|---|---|
| private final boolean removeAllowed Whether remove is allowed | |
| removed | back to summary |
|---|---|
| private boolean removed Has the element been removed | |
| SingletonIterator | back to summary |
|---|---|
| public SingletonIterator(final E object) Constructs a new
| |
| SingletonIterator | back to summary |
|---|---|
| public SingletonIterator(final E object, final boolean removeAllowed) Constructs a new
| |
| 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.
| |
| 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.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Remove the object from this iterator.
| |
| reset | back to summary |
|---|---|
| public void reset() Implements org. Reset the iterator to the start.
| |