org.displaytag.properties
Class SortOrderEnum

java.lang.Object
  extended by org.displaytag.properties.SortOrderEnum

public final class SortOrderEnum
extends java.lang.Object

Enumeration for sort order.

Version:
$Revision: 1081 $ ($Author: fgiust $)
Author:
Fabrizio Giustina

Field Summary
static SortOrderEnum ASCENDING
          Sorted in ascending order (2, "ascending").
static SortOrderEnum DESCENDING
          Sorted in descending order (1, "descending").
 
Method Summary
 boolean equals(java.lang.Object o)
          Only a single instance of a specific enumeration can be created, so we can check using ==.
static SortOrderEnum fromCode(int key)
          lookup a SortOrderEnum by key.
static SortOrderEnum fromCode(java.lang.Integer key)
          lookup a SortOrderEnum by an Integer key.
static SortOrderEnum fromIntegerCode(java.lang.Integer key)
          Deprecated. use fromCode(Integer)
static SortOrderEnum fromName(java.lang.String code)
          Lookup a SortOrderEnum by a String key.
 int getCode()
          returns the int code.
 java.lang.String getName()
          returns the description.
 int hashCode()
           
static java.util.Iterator iterator()
          returns an iterator on all the enumerated instaces.
 java.lang.String toString()
          returns the enumeration description.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DESCENDING

public static final SortOrderEnum DESCENDING
Sorted in descending order (1, "descending").


ASCENDING

public static final SortOrderEnum ASCENDING
Sorted in ascending order (2, "ascending").

Method Detail

getCode

public int getCode()
returns the int code.

Returns:
int code

getName

public java.lang.String getName()
returns the description.

Returns:
String description of the sort order ("ascending" or "descending")

fromCode

public static SortOrderEnum fromCode(int key)
lookup a SortOrderEnum by key.

Parameters:
key - int code
Returns:
SortOrderEnum or null if no SortOrderEnum is found with the given key

fromCode

public static SortOrderEnum fromCode(java.lang.Integer key)
lookup a SortOrderEnum by an Integer key.

Parameters:
key - Integer code - null safe: a null key returns a null Enum
Returns:
SortOrderEnum or null if no SortOrderEnum is found with the given key

fromIntegerCode

public static SortOrderEnum fromIntegerCode(java.lang.Integer key)
Deprecated. use fromCode(Integer)

lookup a SortOrderEnum by an Integer key.

Parameters:
key - Integer code - null safe: a null key returns a null Enum
Returns:
SortOrderEnum or null if no SortOrderEnum is found with the given key

fromName

public static SortOrderEnum fromName(java.lang.String code)
Lookup a SortOrderEnum by a String key.

Parameters:
code - String code - null safe: a null key returns a null Enum
Returns:
SortOrderEnum or null if no SortOrderEnum is found with the given key

iterator

public static java.util.Iterator iterator()
returns an iterator on all the enumerated instaces.

Returns:
iterator

toString

public java.lang.String toString()
returns the enumeration description.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

equals

public boolean equals(java.lang.Object o)
Only a single instance of a specific enumeration can be created, so we can check using ==.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare to
Returns:
hashCode

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()


Copyright © 2002-2007 the Displaytag team. All Rights Reserved.