org.jcreme.enumerations
Class SortOrder

java.lang.Object
  extended byorg.jcreme.enumerations.Enumeration
      extended byorg.jcreme.enumerations.SortOrder
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class SortOrder
extends Enumeration

This class represents a SortOrder (Ascending, Descending, None). The order can be used to multiply with the result of a comparison to get the actual sort result. This class can be used as a sample for Enumeration sub classes.

Version:
$Revision: 1.4 $
Author:
$Author: dbregeon $
See Also:
Serialized Form

Field Summary
static SortOrder ASCENDING
          The 'ASCENDING' enumeration value.
static SortOrder DESCENDING
          The 'DESCENDING' enumeration value.
static int I_ASCENDING
          The value for the 'ASCENDING' enumeration value.
static int I_DESCENDING
          The value for the 'DESCENDING' enumeration value.
static int I_NONE
          The value for the 'NONE' enumeration value.
static SortOrder NONE
          The 'NONE' enumeration value.
static java.lang.String S_ASCENDING
          The name for the 'ASCENDING' enumeration value.
static java.lang.String S_DESCENDING
          The name for the 'DESCENDING' enumeration value.
static java.lang.String S_NONE
          The name for the 'NONE' enumeration value.
(package private) static long serialVersionUID
           
 
Constructor Summary
protected SortOrder(java.lang.String name, int order)
          Creates new SortOrder.
 
Method Summary
static SortOrder get(java.lang.String name)
          This method retrieves a SortOrder instance from its name.
protected  java.util.Hashtable getFromName()
          This method is for internal use only.
 int getOrder()
          This method enables access to the order member.
static SortOrder[] getSortOrders()
          This methods gives the instances of this class.
static Enumeration[] getValues()
          This method enables to retrieve all the possible values of an Enumeration class.
 
Methods inherited from class org.jcreme.enumerations.Enumeration
compareTo, getName, readResolve, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

S_NONE

public static final java.lang.String S_NONE
The name for the 'NONE' enumeration value.

See Also:
Constant Field Values

I_NONE

public static final int I_NONE
The value for the 'NONE' enumeration value.

See Also:
Constant Field Values

NONE

public static final SortOrder NONE
The 'NONE' enumeration value.


S_ASCENDING

public static final java.lang.String S_ASCENDING
The name for the 'ASCENDING' enumeration value.

See Also:
Constant Field Values

I_ASCENDING

public static final int I_ASCENDING
The value for the 'ASCENDING' enumeration value.

See Also:
Constant Field Values

ASCENDING

public static final SortOrder ASCENDING
The 'ASCENDING' enumeration value.


S_DESCENDING

public static final java.lang.String S_DESCENDING
The name for the 'DESCENDING' enumeration value.

See Also:
Constant Field Values

I_DESCENDING

public static final int I_DESCENDING
The value for the 'DESCENDING' enumeration value.

See Also:
Constant Field Values

DESCENDING

public static final SortOrder DESCENDING
The 'DESCENDING' enumeration value.

Constructor Detail

SortOrder

protected SortOrder(java.lang.String name,
                    int order)
             throws java.security.InvalidParameterException
Creates new SortOrder.

Parameters:
name - the name of this enumerated value. It cannot be null.
order - the order value (-1,0 or 1)
Throws:
java.security.InvalidParameterException - if name is null,
See Also:
Enumeration.Enumeration(String)
Method Detail

getOrder

public int getOrder()
This method enables access to the order member.

Returns:
the order value.

getFromName

protected java.util.Hashtable getFromName()
This method is for internal use only.

Specified by:
getFromName in class Enumeration
Returns:
the Hashtable that links the enumerated values names with the actual enumerated value.

get

public static SortOrder get(java.lang.String name)
This method retrieves a SortOrder instance from its name.

Parameters:
name - the name of the SortOrder instance.
Returns:
the SortOrder that has this name. Null if no value corresponding to this name was found.

getSortOrders

public static SortOrder[] getSortOrders()
This methods gives the instances of this class.

Returns:
all the instances of this class.

getValues

public static Enumeration[] getValues()
This method enables to retrieve all the possible values of an Enumeration class.

Returns:
the values for this class.


Copyright 2006 null. All Rights Reserved.