ewe.util
Class ObjectIterator
java.lang.Object
ewe.util.IteratorEnumerator
ewe.util.ObjectIterator
- All Implemented Interfaces:
- Enumeration, Iterator
- public class ObjectIterator
- extends IteratorEnumerator
This is an Iterator which iterates either a single Object or no Object
at all.
|
Constructor Summary |
ObjectIterator(Object which)
Create an ObjectIterator which iterates the provided Object only. |
|
Method Summary |
boolean |
hasNext()
Returns whether there are more Objects to retrieve. |
Object |
next()
Returns the next Object in the sequence. |
ObjectIterator
public ObjectIterator(Object which)
- Create an ObjectIterator which iterates the provided Object only. If
the specified Object is null, it will iterate through no Objects at
all (i.e. hasNext() will always return false).
hasNext
public boolean hasNext()
- Description copied from interface:
Iterator
- Returns whether there are more Objects to retrieve.
next
public Object next()
- Description copied from interface:
Iterator
- Returns the next Object in the sequence.
- Returns:
- the next Object in the sequence.