Class BiList<E>

java.lang.Object
  extended by BiList<E>
All Implemented Interfaces:
BiListI<E>

 class BiList<E>
extends Object
implements BiListI<E>

A circularly linked class implementing the BiListI interface.


Nested Class Summary
private  class BiList.BiIterator
          A true inner class that includes a link (BiList.this) to the enclosing BiList.
(package private) static class BiList.BiListException
           
private static class BiList.Node<E>
           
 
Field Summary
private  BiList.Node<E> head
          The header node for the list.
private  int length
          The length of this list.
 
Constructor Summary
BiList()
           
 
Method Summary
 BiList<E> clear()
          Clears this;
(package private)  boolean delete(E elt)
           
 BiList<E> insertFront(E o)
          Inserts object o at the front of this.
 BiList<E> insertRear(E o)
          Inserts the object o at the rear of this list.
 boolean isEmpty()
           
 int length()
           
<R> BiList<R>
map(ILambda<E,R> f)
           
 BiIteratorI<E> newIterator()
           
 BiList<E> newList()
          Constructs a new empty BiList.
 E remFront()
          Removes the object at the front of the list.
 E remRear()
          Removes the last element of this list.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

head

private BiList.Node<E> head
The header node for the list.


length

private int length
The length of this list.

Constructor Detail

BiList

BiList()
Method Detail

toString

public String toString()
Overrides:
toString in class Object

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface BiListI<E>
Returns:
true if this enumeration is empty.

newList

public BiList<E> newList()
Description copied from interface: BiListI
Constructs a new empty BiList.

Specified by:
newList in interface BiListI<E>

length

public int length()
Specified by:
length in interface BiListI<E>
Returns:
the length of this list.

clear

public BiList<E> clear()
Description copied from interface: BiListI
Clears this;

Specified by:
clear in interface BiListI<E>
Returns:
this list.

map

public <R> BiList<R> map(ILambda<E,R> f)

insertFront

public BiList<E> insertFront(E o)
Description copied from interface: BiListI
Inserts object o at the front of this.

Specified by:
insertFront in interface BiListI<E>
Returns:
this list.

insertRear

public BiList<E> insertRear(E o)
Description copied from interface: BiListI
Inserts the object o at the rear of this list.

Specified by:
insertRear in interface BiListI<E>
Returns:
this list.

remFront

public E remFront()
Description copied from interface: BiListI
Removes the object at the front of the list.

Specified by:
remFront in interface BiListI<E>
Returns:
the removed object.

newIterator

public BiIteratorI<E> newIterator()
Specified by:
newIterator in interface BiListI<E>
Returns:
a new iterator for traversing this.

remRear

public E remRear()
Description copied from interface: BiListI
Removes the last element of this list.

Specified by:
remRear in interface BiListI<E>

delete

boolean delete(E elt)