de.rwth.utils
Class  AbstractIterator
java.lang.Object
  |
  +--de.rwth.utils.AbstractIterator
- All Implemented Interfaces: 
- java.util.Iterator
- public abstract class AbstractIterator- extends java.lang.Object- implements java.util.Iterator
Provides a default implementation for the Iterator interface. To get
 a working implementation of Iterator only the methods produceNext() and externalView(Object o) must be defined in a subclass.
 
 
 
 This class allows to distinguish between internal (seen inside this class) and
 external representation (seen by the user of the Iterator).
- Version: 
- $Id: AbstractIterator.java,v 1.2 2002/09/17 06:53:53 mohnen Exp $
- Author: 
- Markus Mohnen
 
| Method Summary | 
| abstract  java.lang.Object | externalView(java.lang.Object o)The
 externalViewmethod is supposed to convert internal to external
 representation. | 
|  boolean | hasNext()
 | 
|  java.lang.Object | next()
 | 
| abstract  java.lang.Object | produceNext()The
 produceNextmethod is supposed to produce the internal
 representation of the next element of theIterator. | 
|  void | remove()
 | 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
AbstractIterator
public AbstractIterator()
hasNext
public boolean hasNext()
- 
- Specified by: 
- hasNextin interface- java.util.Iterator
 
next
public java.lang.Object next()
                      throws java.util.NoSuchElementException
- 
- Specified by: 
- nextin interface- java.util.Iterator
 
remove
public void remove()
- 
- Specified by: 
- removein interface- java.util.Iterator
 
produceNext
public abstract java.lang.Object produceNext()
- The produceNextmethod is supposed to produce the internal
 representation of the next element of theIterator. If there are no
 more elements, it should indicate this byte returningnull. This
 method is guaranteed to be called exactly once to produce a new element,
 independently on how oftenhasNext()is called before a call
 tonext().
- 
 
- 
- Returns:
- a value of type Object
 
externalView
public abstract java.lang.Object externalView(java.lang.Object o)
- The externalViewmethod is supposed to convert internal to external
 representation.
- 
 
- 
- Parameters:
- o- a value of type- Object
- Returns:
- a value of type Object