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.
-
SortedEnumeration(Enumeration, Comparer)
- Creates a new SortedEnumeration.
-
hasMoreElements()
- Returns true if the enumeration has more elements
-
nextElement()
- Returns the next element in the enumeration
-
string(Enumeration)
- Requires that the elements of sourceEnumeration be strings.
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.
hasMoreElements
public boolean hasMoreElements()
- Returns true if the enumeration has more elements
nextElement
public Object nextElement()
- Returns the next element in the enumeration
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