CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.util
Class SortedEnumerator

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.SimpleEnumerator
          extended by com.tangosol.util.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

Field Summary
 
Fields inherited from class com.tangosol.util.SimpleEnumerator
m_aoItem, m_fForward, m_iItem, m_ofLimit
 
Constructor Summary
SortedEnumerator(Enumeration enmr)
          Construct a Sorted enumerator.
SortedEnumerator(Iterator iterator)
          Construct a Sorted enumerator.
 
Method Summary
static Object[] toArray(Enumeration enmr)
          Return the contents of the passed Enumeration as a sorted array.
static Object[] toArray(Iterator iterator)
          Return the contents of the passed Iterator as a sorted array.
 
Methods inherited from class com.tangosol.util.SimpleEnumerator
hasMoreElements, hasNext, next, nextElement, remove, toArray, toArray, toArray, toArray
 

Constructor Detail

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 Detail

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

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation