Release Planner v1.0

rp.util
Class TwoList.IteratorA

java.lang.Object
  |
  +--rp.util.TwoList.IteratorDefault
        |
        +--rp.util.TwoList.IteratorA
All Implemented Interfaces:
TwoList.Iterator
Enclosing class:
TwoList

protected static class TwoList.IteratorA
extends rp.util.TwoList.IteratorDefault

An implementation of the Iterator interface for A-lists.


Field Summary
protected  TwoList head
           
protected  TwoList node
           
 
Constructor Summary
protected TwoList.IteratorA(TwoList node)
           
 
Method Summary
 TwoList getTwoList()
          Return the current element.
 void goNext()
          Moves to the next element.
 void goPrevious()
          Moves to the previous element.
 boolean hasNext()
          Tests if there is any next element.
 boolean hasPrevious()
          Tests if there is any previous element.
 boolean isReset()
          Tests if this iterator is set to the starting position.
 void reset()
          Return the iterator to the starting position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

head

protected TwoList head

node

protected TwoList node
Constructor Detail

TwoList.IteratorA

protected TwoList.IteratorA(TwoList node)
Method Detail

hasNext

public boolean hasNext()
Description copied from interface: TwoList.Iterator
Tests if there is any next element. Can't move the iterator forward unless there is.

Specified by:
hasNext in interface TwoList.Iterator
Specified by:
hasNext in class rp.util.TwoList.IteratorDefault
Returns:
if there is a next element.

goNext

public void goNext()
Description copied from interface: TwoList.Iterator
Moves to the next element. Illegal if there isn't a next element.

Specified by:
goNext in interface TwoList.Iterator
Specified by:
goNext in class rp.util.TwoList.IteratorDefault

hasPrevious

public boolean hasPrevious()
Description copied from interface: TwoList.Iterator
Tests if there is any previous element. Can't move the iterator backwards unless there is.

Specified by:
hasPrevious in interface TwoList.Iterator
Specified by:
hasPrevious in class rp.util.TwoList.IteratorDefault
Returns:
if there is a previous element.

goPrevious

public void goPrevious()
Description copied from interface: TwoList.Iterator
Moves to the previous element. Illegal if there isn't a previous element.

Specified by:
goPrevious in interface TwoList.Iterator
Specified by:
goPrevious in class rp.util.TwoList.IteratorDefault

reset

public void reset()
Description copied from interface: TwoList.Iterator
Return the iterator to the starting position. (From which one can either move forward to the first node or backwards to the last node).

Specified by:
reset in interface TwoList.Iterator

isReset

public boolean isReset()
Description copied from interface: TwoList.Iterator
Tests if this iterator is set to the starting position.

Specified by:
isReset in interface TwoList.Iterator
Returns:
if this iterator is set at the starting position

getTwoList

public TwoList getTwoList()
Description copied from interface: TwoList.Iterator
Return the current element. Illegal if isReset().

Specified by:
getTwoList in interface TwoList.Iterator
Returns:
the current element

Release Planner v1.0