wt.util
Class SortedEnumeration

java.lang.Object
  extended by wt.util.SortedEnumeration
All Implemented Interfaces:
Serializable, Enumeration

public class SortedEnumeration
extends Object
implements Enumeration, Serializable

An enumeration that returns objects in sorted order.

Supported API: true
Supported API: true

See Also:
Serialized Form

Constructor Summary
SortedEnumeration(Enumeration source, CollationKeyFactory key_factory)
          Construct a sorted Enumeration containing the elements of another Enumeration.
SortedEnumeration(Enumeration source, CollationKeyFactory key_factory, int order)
          Construct a sorted Enumeration containing the elements of another Enumeration.
 
Method Summary
 boolean hasMoreElements()
          
Supported API: true
 Object nextElement()
          
Supported API: true
 int size()
          Return the number of elements remaining in the enumeration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedEnumeration

public SortedEnumeration(Enumeration source,
                         CollationKeyFactory key_factory)
Construct a sorted Enumeration containing the elements of another Enumeration. Elements are sorted into ascending order.

Supported API: true

Parameters:
source - source Enumeration
collation_key_factory - factory to produce collation keys for the elements
order - sort order (ASCENDING or DECENDING)

SortedEnumeration

public SortedEnumeration(Enumeration source,
                         CollationKeyFactory key_factory,
                         int order)
Construct a sorted Enumeration containing the elements of another Enumeration.

Supported API: true

Parameters:
source - source Enumeration
collation_key_factory - factory to produce collation keys for the elements
order - sort order (ASCENDING or DECENDING)
Method Detail

hasMoreElements

public boolean hasMoreElements()

Supported API: true

Specified by:
hasMoreElements in interface Enumeration

nextElement

public Object nextElement()

Supported API: true

Specified by:
nextElement in interface Enumeration

size

public int size()
Return the number of elements remaining in the enumeration. Since each element of the underlying enumeration had to be accessed in order to sort them, the total number of elements is known.

Supported API: true

Returns:
number of elements remaining