All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class DataStructures.SortListItr

java.lang.Object
   |
   +----DataStructures.LinkedListItr
           |
           +----DataStructures.SortListItr

public class SortListItr
extends DataStructures.LinkedListItr
Linked list implementation of the sorted list iterator using a header node. Insertions are done to maintian sorted order.

See Also:
LinkedList

Constructor Index

 o SortListItr(List)
Construct the list.

Method Index

 o insert(Comparable)
Insert in sorted order.
 o insert(Object)
Overridden to generate an exception.
 o main(String[])

Constructors

 o SortListItr
 public SortListItr(DataStructures.List anyList) throws java.lang.ClassCastException
Construct the list. The result of the construction is the same as for ListItr.

Parameters:
anyList - a LinkedList object to which this iterator is permanently bound. This constructor is provided for convenience. If anyList is not a LinkedList object, a ClassCastException will result.

Methods

 o insert
 public void insert(java.lang.Object x) throws Exceptions.ItemNotFound
Overridden to generate an exception. An insert routine that accepts a Comparable object should be used.

Parameters:
x - an Object that is attempted to be inserted.
Throws: ItemNotFound
thrown if this method is executed.
Overrides:
insert in class DataStructures.LinkedListItr
 o insert
 public void insert(Supporting.Comparable x)
Insert in sorted order. Assumes that the list is already sorted. current is set to the inserted node on success. No exceptions are thrown.

Parameters:
x - the item to insert.
 o main
 public static void main(java.lang.String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index