ewe.util
Class IteratorEnumerator
java.lang.Object
ewe.util.IteratorEnumerator
- All Implemented Interfaces:
- Enumeration, Iterator
- Direct Known Subclasses:
- ObjectIterator
- public abstract class IteratorEnumerator
- extends Object
- implements Enumeration, Iterator
This is an object that can be used to implement an object that is both an
Iterator and an Enumeration. To do this simply override and provide an
implementation for Iterator.hasNext() and Iterator.next() and (optionally)
Iterator.remove(). By default remove() will throw an UnsupportedOperationException
(or a RuntimeException on a Java 1.1 system).
|
Method Summary |
boolean |
hasMoreElements()
This returns the hasNext() method. |
Object |
nextElement()
This returns the next() method. |
void |
remove()
The default version of this will throw an UnsupportedOperationException. |
IteratorEnumerator
public IteratorEnumerator()
hasMoreElements
public boolean hasMoreElements()
- This returns the hasNext() method.
- Specified by:
hasMoreElements in interface Enumeration
nextElement
public Object nextElement()
- This returns the next() method.
- Specified by:
nextElement in interface Enumeration
remove
public void remove()
- The default version of this will throw an UnsupportedOperationException.
- Specified by:
remove in interface Iterator