Class SortedEnumerator

All Implemented Interfaces:
Enumeration, Iterator

public class SortedEnumerator extends SimpleEnumerator
Sorts the contents of the passed enumerator then enumerates those contents.
Version:
1.00, 02/15/99
Author:
Cameron Purdy
  • Constructor Details

    • SortedEnumerator

      public SortedEnumerator(Enumeration enmr)
      Construct a Sorted enumerator.
      Parameters:
      enmr - the Enumeration that needs to be sorted
    • SortedEnumerator

      public SortedEnumerator(Iterator iterator)
      Construct a Sorted enumerator.
      Parameters:
      iterator - the Iterator that needs to be sorted
  • Method Details

    • toArray

      public static Object[] toArray(Enumeration enmr)
      Return the contents of the passed Enumeration as a sorted array.
      Parameters:
      enmr - an Enumeration of potentially unsorted objects
      Returns:
      an array of sorted objects
    • toArray

      public static Object[] toArray(Iterator iterator)
      Return the contents of the passed Iterator as a sorted array.
      Parameters:
      iterator - an Iterator of potentially unsorted objects
      Returns:
      an array of sorted objects