| |
|
| java.lang.Object net.sf.jga.util.SingletonIterator
SingletonIterator | public class SingletonIterator implements ListIterator<T>,Iterable<T>(Code) | | Iterates over a single item. The iterator is structured as a list iterator,
but the list is a fixed size (1). The value may be changed after it has
been retrieved at least one time.
author: David A. Hall |
Constructor Summary | |
public | SingletonIterator(T value) Builds a SingletonIterator that will return the given value. |
SingletonIterator | public SingletonIterator(T value)(Code) | | Builds a SingletonIterator that will return the given value.
|
add | public void add(T arg)(Code) | | |
hasNext | public boolean hasNext()(Code) | | Returns true if the item has not yet been returned.
true if the item has not yet been returned |
hasPrevious | public boolean hasPrevious()(Code) | | Returns true if the item has not yet been returned.
true if the item has not yet been returned |
nextIndex | public int nextIndex()(Code) | | |
previous | public T previous()(Code) | | Returns the single item
the single item throws: NoSuchElementException - if the item has already been returned |
previousIndex | public int previousIndex()(Code) | | |
remove | public void remove()(Code) | | |
set | public void set(T value)(Code) | | |
|
|
|