All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class DataStructures.SortListItr


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

See Also:

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[])


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

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.


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

x - an Object that is attempted to be inserted.
Throws: ItemNotFound
thrown if this method is executed.
insert in class LinkedListItr
 o insert
public void insert(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.

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

All Packages  Class Hierarchy  This Package  Previous  Next  Index