fi.joensuu.cs.tra
Class EOL<E>

java.lang.Object
  extended by fi.joensuu.cs.tra.ListNode<E>
      extended by fi.joensuu.cs.tra.EOL<E>

public class EOL<E>
extends ListNode<E>

EOL is a subclass of ListNode used to mark the end of the end of TraLinkedList. Its only uses are basically in checking whether the next node in a TraLinkedList is the end of the list and for use as a positional parameter when inserting ListNodes at the end of the list. For example

   // Traversing a list (assuming the list is not empty)
   node = list.first();
   while (node != list.EOL)
     node = node.next();

   // Inserting (appending) at the end of the list
   list.insert(list.EOL, something);
 


Method Summary
 E getElement()
          Always throws an TraLinkedListException.
 ListNode<E> next()
          Always throws a TraLinkedListException.
 ListNode<E> previous()
          Always throws an TraLinkedListException.
 String toString()
          Returns the element's toString().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

previous

public ListNode<E> previous()
Always throws an TraLinkedListException.

Overrides:
previous in class ListNode<E>
Returns:
this node's previous node or null if none.

next

public ListNode<E> next()
Always throws a TraLinkedListException.

Overrides:
next in class ListNode<E>
Returns:
this node's next node or EOL if none.
Throws:
TraLinkedListExecption

getElement

public E getElement()
Always throws an TraLinkedListException.

Overrides:
getElement in class ListNode<E>
Returns:
this node's element or null if none.

toString

public String toString()
Description copied from class: ListNode
Returns the element's toString().

Overrides:
toString in class ListNode<E>