All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class list.ListEnum

java.lang.Object
   |
   +----list.ListEnum

public class ListEnum
extends Object
implements Enumeration
The ListEnum class implements an Enumeration for Linked Lists. ListEnum objects are mutable.

Author:
Kathy Yelick

Constructor Index

 o ListEnum(ListNode)
Creates a new enumeration for the elements linked with ListNodes starting with l.

Method Index

 o hasMoreElements()
Tests if this enumeration contains more elements.
 o nextElement()
Returns the next element of this enumeration.

Constructors

 o ListEnum
 public ListEnum(ListNode l)
Creates a new enumeration for the elements linked with ListNodes starting with l. Requires that there are no cycles in the list.

Methods

 o hasMoreElements
 public boolean hasMoreElements()
Tests if this enumeration contains more elements.

Returns:
true if this enumeration contains more elements; false otherwise
 o nextElement
 public Object nextElement()
Returns the next element of this enumeration. Modifies the enumeration to move the enumeration past the returned element of the list.

Returns:
the next element of this enumeration.

All Packages  Class Hierarchy  This Package  Previous  Next  Index