ewe.util
Class IteratorEnumerator

java.lang.Object
  extended byewe.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).


Constructor Summary
IteratorEnumerator()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 
Methods inherited from interface ewe.util.Iterator
hasNext, next
 

Constructor Detail

IteratorEnumerator

public IteratorEnumerator()
Method Detail

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