ewe.util
Class ObjectIterator

java.lang.Object
  extended byewe.util.IteratorEnumerator
      extended byewe.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.
 
Methods inherited from class ewe.util.IteratorEnumerator
hasMoreElements, nextElement, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Constructor Detail

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).

Method Detail

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.