Interface BiIteratorI<E>

All Known Implementing Classes:
BiList.BiIterator

interface BiIteratorI<E>


Method Summary
 boolean atEnd()
           
 boolean atStart()
           
 E currentItem()
           
 E first()
          Moves cursor to the first element f of the collection.
 void insert(E o)
          Destructively inserts the object o immediately before the current item.
 E last()
          Places the cursor on the last element l of the collection.
 E next()
          Moves cursor to the next element n of the collection.
 E prev()
          Moves cursor to the previous element p of the collection.
 E remove()
          Removes the current item.
 

Method Detail

first

E first()
Moves cursor to the first element f of the collection. Behavior unspecified on empty collecton.

Returns:
the first element f.

last

E last()
Places the cursor on the last element l of the collection. Behavior is unspecified if the collection is empty.

Returns:
the last element l.

next

E next()
Moves cursor to the next element n of the collection. Behavior unspecified on empty collecton.

Returns:
the next element n.

prev

E prev()
Moves cursor to the previous element p of the collection. Behavior is unspecified if the collection is empty.

Returns:
the next element p.

atEnd

boolean atEnd()
Returns:
true if cursor is pointing to the dummy node (the header) beyond the last element of the collection.

atStart

boolean atStart()
Returns:
true if cursor is pointing to the first element of the collection.

currentItem

E currentItem()
Returns:
the value of the current element (pointed to by the cursor).
Throws:
IteratorException - if no such element exists.

insert

void insert(E o)
Destructively inserts the object o immediately before the current item. If the list is empty, or the cursor is atEnd(), the node is inserted immediately before the end of the list.


remove

E remove()
Removes the current item.

Throws:
an - IteratorException if the cursor is atEnd().