Google

JanosVM v0.6.0 Java API Documentation: Class List
JanosVM v0.6.0 Java API

edu.utah.janosvm.sys
Class List

java.lang.Object
  |
  +--edu.utah.janosvm.sys.List

public class List
extends java.lang.Object

Root for a doubly linked list.

Author:
Tim Stack, Utah Janos Team
See Also:
ListNode

Field Summary
 ListNode head
          The header for the list.
 ListNode tail
          The tail node for the list.
 
Constructor Summary
List()
          Construct an empty list object.
 
Method Summary
 void addHead(ListNode ln)
          Add a node to the head of the list.
 void addTail(ListNode ln)
          Add a node to the tail of the list.
 int count()
           
 boolean isEmpty()
           
 ListNode nodeAt(int index)
           
 ListNode remHead()
          Remove and return the node at the head of the list, or null if its empty.
 ListNode remTail()
          Remove and return the node at the tail of the list, or null if its empty.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

head

public ListNode head
The header for the list.

tail

public ListNode tail
The tail node for the list.
Constructor Detail

List

public List()
Construct an empty list object.
Method Detail

count

public int count()
Returns:
The number of nodes in the list.

nodeAt

public ListNode nodeAt(int index)

addHead

public void addHead(ListNode ln)
Add a node to the head of the list.
Parameters:
ln - The node to add.

addTail

public void addTail(ListNode ln)
Add a node to the tail of the list.
Parameters:
ln - The node to add.

remHead

public ListNode remHead()
Remove and return the node at the head of the list, or null if its empty.
Returns:
The node to removed.

remTail

public ListNode remTail()
Remove and return the node at the tail of the list, or null if its empty.
Returns:
The node to removed.

isEmpty

public boolean isEmpty()
Returns:
True if the list is empty, false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

JanosVM v0.6.0 Java API

This documentation is Copyright (C) 2000-2002 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Mar 17, 2002