All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class DataStructures.CursorList

java.lang.Object
    |
    +----DataStructures.CursorList

public class CursorList
extends Object
Linked list implementation of the list using a header node; cursor version. Access to the list is via CursorListItr.

See Also:
CursorListItr

Constructor Index

 o CursorList()
Construct the list.

Method Index

 o find(Object)
Return iterator corresponding to the first node containing an item.
 o findPrevious(Object)
Return iterator prior to the first node containing an item.
 o first()
Return an iterator representing the first node in the list.
 o insert(Object, CursorListItr)
Insert after p.
 o isEmpty()
Test if the list is logically empty.
 o main(String[])
 o makeEmpty()
Make the list logically empty.
 o printList(CursorList)
 o remove(Object)
Remove the first occurrence of an item.
 o zeroth()
Return an iterator representing the header node.

Constructors

 o CursorList
public CursorList()
Construct the list.

Methods

 o isEmpty
public boolean isEmpty()
Test if the list is logically empty.

Returns:
true if empty, false otherwise.
 o makeEmpty
public void makeEmpty()
Make the list logically empty.

 o zeroth
public CursorListItr zeroth()
Return an iterator representing the header node.

 o first
public CursorListItr first()
Return an iterator representing the first node in the list. This operation is valid for empty lists.

 o insert
public void insert(Object x,
                   CursorListItr p)
Insert after p.

Parameters:
x - the item to insert.
p - the position prior to the newly inserted item.
 o find
public CursorListItr find(Object x)
Return iterator corresponding to the first node containing an item.

Parameters:
x - the item to search for.
Returns:
an iterator; iterator isPastEnd if item is not found.
 o findPrevious
public CursorListItr findPrevious(Object x)
Return iterator prior to the first node containing an item.

Parameters:
x - the item to search for.
Returns:
appropriate iterator if the item is found. Otherwise, the iterator corresponding to the last element in the list is returned.
 o remove
public void remove(Object x)
Remove the first occurrence of an item.

Parameters:
x - the item to remove.
 o printList
public static void printList(CursorList theList)
 o main
public static void main(String[] args)

All Packages  Class Hierarchy  This Package  Previous  Next  Index