All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sdsu.util.SortedEnumeration

java.lang.Object
   |
   +----sdsu.util.SortedEnumeration

public class SortedEnumeration
extends Object
implements Enumeration
SortedEnumeration is an enumerations that returns elements in sorted order. Requires that all elements of the source enumeration be of the type expected by the comparer provided to the constructor.


Constructor Index

 o SortedEnumeration(Enumeration, Comparer)
Creates a new SortedEnumeration.

Method Index

 o hasMoreElements()
Returns true if the enumeration has more elements
 o nextElement()
Returns the next element in the enumeration
 o string(Enumeration)
Requires that the elements of sourceEnumeration be strings.

Constructors

 o SortedEnumeration
 public SortedEnumeration(Enumeration sourceEnumeration,
                          Comparer order)
Creates a new SortedEnumeration. The elements of sourceEnumeration are return in sorted order indicated by order.

Throws: ClassCastException
If all elements of sourceEnumeration are not the type expected by the comparer order . ClassCastException is a RuntimeException, so compiler does not force you to catch this exception.

Methods

 o hasMoreElements
 public boolean hasMoreElements()
Returns true if the enumeration has more elements

 o nextElement
 public Object nextElement()
Returns the next element in the enumeration

 o string
 public static Enumeration string(Enumeration sourceEnumeration)
Requires that the elements of sourceEnumeration be strings. Returns an enumeration with the elements of sourceEnumeration in increasing sorted order


All Packages  Class Hierarchy  This Package  Previous  Next  Index