structure5
Class AbstractListIterator<E>
java.lang.Object
structure5.AbstractIterator<E>
structure5.AbstractListIterator<E>
- All Implemented Interfaces:
- Iterable<E>, Enumeration<E>, Iterator<E>, ListIterator<E>
public abstract class AbstractListIterator<E>
- extends AbstractIterator<E>
- implements ListIterator<E>
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(E o)
|
abstract E |
get()
Returns the value currently being considered by the AbstractIterator. |
void |
remove()
If implemented, removes the currently visited value from the structure. |
void |
set(E o)
|
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.
get
public abstract E 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<E>
- 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 Iterator<E>
- Specified by:
remove
in interface ListIterator<E>
- Overrides:
remove
in class AbstractIterator<E>
set
public void set(E o)
- Specified by:
set
in interface ListIterator<E>
add
public void add(E o)
- Specified by:
add
in interface ListIterator<E>