Package wt.util

Class SortedEnumeration

java.lang.Object
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:
  • Constructor Details

    • 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 Details

    • 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