Tea Java Runtime API
Version 3.1.0

com.pdmfc.tea.util
Class SList

java.lang.Object
  |
  +--com.pdmfc.tea.util.SList

public class SList
extends java.lang.Object

Implements an ordered list of objects. The list can be traversed from its beggining to its end.


Field Summary
protected  SListNode _head
           
protected  int _size
           
protected  SListNode _tail
           
 
Constructor Summary
SList()
          This constructor builds an empty list.
 
Method Summary
 void append(java.lang.Object obj)
          Appends the object given as argument to the end of the list.
 java.util.Enumeration elements()
          Deprecated. Use the iterator() method instead.
 void empty()
          Emptys the list.
 SListNode head()
           
 java.util.Iterator iterator()
           
 void prepend(java.lang.Object obj)
          Inserts the object given as argument to the start of the list.
 int size()
          Returns the number of elements on the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_head

protected SListNode _head

_tail

protected SListNode _tail

_size

protected int _size
Constructor Detail

SList

public SList()
This constructor builds an empty list.
Method Detail

append

public void append(java.lang.Object obj)
Appends the object given as argument to the end of the list.
Parameters:
obj - Reference to the object to be appended to the end of the list.

prepend

public void prepend(java.lang.Object obj)
Inserts the object given as argument to the start of the list.
Parameters:
obj - Reference to the object to be inserted at the start of the list.

empty

public void empty()
Emptys the list.

size

public int size()
Returns the number of elements on the list.
Returns:
The number of elements on the list.

iterator

public java.util.Iterator iterator()
Returns:
An Enumeration object that may be used to iterate over the list elements.

elements

public java.util.Enumeration elements()
Deprecated. Use the iterator() method instead.

Builds an Enumeration to iterate over the list elements. The Enumeration will retrieve the elements by their order in the list.
Returns:
An Enumeration object that may be used to iterate over the list elements.

head

public SListNode head()

Tea Java Runtime API
Version 3.1.0

© 2002 PDM&FC, All Rights Reserved.