wt.workflow
Class SortedEnumByPrincipal

java.lang.Object
  extended bywt.workflow.SortedEnumByPrincipal
All Implemented Interfaces:
Enumeration, Serializable

public class SortedEnumByPrincipal
extends Object
implements Enumeration, Serializable

An enumeration that returns objects in sorted order.

Supported API: true
Supported API: true

See Also:
Serialized Form

Nested Class Summary
(package private) static class SortedEnumByPrincipal.SortEntry
           
(package private) static class SortedEnumByPrincipal.SortPredicate
           
 
Field Summary
static int ASCENDING
           
private  int count
           
static int DESCENDING
           
private static long serialVersionUID
           
private  Object[] sorted
           
private static String versionID
           
 
Constructor Summary
SortedEnumByPrincipal(Enumeration source, boolean byFullName, int order)
          Construct a sorted Enumeration containing the WTPrincipals of another Enumeration.
SortedEnumByPrincipal(Enumeration source, CollationKeyFactory key_factory)
          Construct a sorted Enumeration containing the elements of another Enumeration.
SortedEnumByPrincipal(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
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

ASCENDING

public static final int ASCENDING
See Also:
Constant Field Values

DESCENDING

public static final int DESCENDING
See Also:
Constant Field Values

sorted

private Object[] sorted

count

private int count
Constructor Detail

SortedEnumByPrincipal

public SortedEnumByPrincipal(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

SortedEnumByPrincipal

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

Supported API: true

Parameters:
source - source Enumeration
order - sort order (ASCENDING or DECENDING)

SortedEnumByPrincipal

public SortedEnumByPrincipal(Enumeration source,
                             boolean byFullName,
                             int order)
Construct a sorted Enumeration containing the WTPrincipals of another Enumeration.

Supported API: true

Parameters:
source - source Enumeration
byFullName - boolean to collate by FullName instead of Name attribute. If the elements are WTUsers, true will sort by FullName, else by web server id. If the elements are WTGroups, the sort will be by GroupName regardless.
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