Release Planner v1.0

rp.util
Interface TwoList.Iterator

All Known Subinterfaces:
DOMObject.Iterator, DOMRelation.Endpoint.Iterator, DOMRelation.Instance.Iterator
All Known Implementing Classes:
rp.util.TwoList.IteratorDefault
Enclosing interface:
TwoList

protected static interface TwoList.Iterator

Used for iterating over TwoList lists (A or B). Implementing classes should provide appropriately typecast accessor methods as follows:

 // gets the current element
 public T get() { return (T)getTwoList(); }

 // moves to the next node then gets it
 public T next() { goNext(); return get(); }

 // moves to the previous node then gets it
 public T previous() { goPrevious(); return get(); }
 


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.
 

Method Detail

reset

public void reset()
Return the iterator to the starting position. (From which one can either move forward to the first node or backwards to the last node).


isReset

public boolean isReset()
Tests if this iterator is set to the starting position.

Returns:
if this iterator is set at the starting position

hasNext

public boolean hasNext()
Tests if there is any next element. Can't move the iterator forward unless there is.

Returns:
if there is a next element.

goNext

public void goNext()
Moves to the next element. Illegal if there isn't a next element.


hasPrevious

public boolean hasPrevious()
Tests if there is any previous element. Can't move the iterator backwards unless there is.

Returns:
if there is a previous element.

goPrevious

public void goPrevious()
Moves to the previous element. Illegal if there isn't a previous element.


getTwoList

public TwoList getTwoList()
Return the current element. Illegal if isReset().

Returns:
the current element

Release Planner v1.0