structure
Class AbstractListIterator<ELTTYPE>
java.lang.Object
structure.AbstractIterator<ELTTYPE>
structure.AbstractListIterator<ELTTYPE>
- All Implemented Interfaces:
- java.util.Enumeration<ELTTYPE>, java.util.Iterator<ELTTYPE>, java.util.ListIterator<ELTTYPE>
public abstract class AbstractListIterator<ELTTYPE>
- extends AbstractIterator<ELTTYPE>
- implements java.util.ListIterator<ELTTYPE>
Base class for the implementation of a list Iterator.
The methods provided in this class have no executable bodies and will throw
errors if the user attempts to invoke them.
Method Summary |
void |
add(ELTTYPE o)
|
abstract ELTTYPE |
get()
Returns the value currently being considered by the AbstractIterator. |
void |
remove()
If implemented, removes the currently visited value from the structure. |
void |
set(ELTTYPE o)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.ListIterator |
hasNext, hasPrevious, next, nextIndex, previous, previousIndex |
AbstractListIterator
public AbstractListIterator()
- Default constructor (for base class invocation).
Does nothing.
Remind Sun (jdk-comments@java.sun.com) that automatically implemented default
constructors are a silly thing.
- Post:
- does nothing
get
public abstract ELTTYPE get()
- Description copied from class:
AbstractIterator
- Returns the value currently being considered by the AbstractIterator.
This method is required by neither
Iterator
nor
Enumeration
. This method should be implemented,
however, to provide better support for for
-loops.
- Specified by:
get
in class AbstractIterator<ELTTYPE>
- Returns:
- the next value to be considered in iterator
remove
public void remove()
- Description copied from class:
AbstractIterator
- If implemented, removes the currently visited value from the structure.
remove
should not be called unless it is overridden.
- Specified by:
remove
in interface java.util.Iterator<ELTTYPE>
- Specified by:
remove
in interface java.util.ListIterator<ELTTYPE>
- Overrides:
remove
in class AbstractIterator<ELTTYPE>
set
public void set(ELTTYPE o)
- Specified by:
set
in interface java.util.ListIterator<ELTTYPE>
add
public void add(ELTTYPE o)
- Specified by:
add
in interface java.util.ListIterator<ELTTYPE>