com.sap.netweaver.bc.uwl

Class PriorityEnum

java.lang.Object
  extended bycom.sap.netweaver.bc.uwl.PriorityEnum
All Implemented Interfaces:
Comparable, Serializable

public class PriorityEnum
extends Object
implements Serializable, Comparable

The PriorityEnum class handles enumeration of item's priorities.

See Also:
Serialized Form

Field Summary
static PriorityEnum HIGH
          This indicates "HIGH" priority.
static PriorityEnum LOW
          This indicates "LOW" priority.
static PriorityEnum NORMAL
          This indicates "NORMAL" priority.
protected static String RESOURCE_PREFIX
           
static PriorityEnum UNDEFINED
          This stands for the priority that is not defined.
static PriorityEnum VERYHIGH
          This indicates "VERYHIGH" priority.
 
Method Summary
 int compareTo(Object arg)
          This method compares the priorities based on this and arg.
 boolean equals(Object obj)
           
static PriorityEnum getEnumFromInt(int val)
           
static PriorityEnum getEnumFromKey(String key)
           
static Iterator getIterator()
           
 String getKey()
           
 String getText()
          Returns the readable text like "VERYHIGH","HIGH" etc.
 String getText(Locale locale)
          Return the Display text for this enum type.
 int getValue()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE_PREFIX

protected static final String RESOURCE_PREFIX
See Also:
Constant Field Values

UNDEFINED

public static final PriorityEnum UNDEFINED
This stands for the priority that is not defined. Its integer value equals 0. The key is an empty string.


LOW

public static final PriorityEnum LOW
This indicates "LOW" priority. The numerical value equals 1. The key is "LOW".


NORMAL

public static final PriorityEnum NORMAL
This indicates "NORMAL" priority. The numerical value equals 2. The key is "NORMAL".


HIGH

public static final PriorityEnum HIGH
This indicates "HIGH" priority. The numerical value equals 3. The key is "HIGH".


VERYHIGH

public static final PriorityEnum VERYHIGH
This indicates "VERYHIGH" priority. The numerical value equals 4. The key is "VERYHIGH".

Method Detail

getIterator

public static Iterator getIterator()
Returns:
Iterator the iterator on the values of the map that contains various priority types.
See Also:
Map.values()

hashCode

public int hashCode()
Returns:
int the hashCode which is equal to value.
See Also:
Object.hashCode()

getValue

public int getValue()
Returns:
int the value.

getKey

public String getKey()
Returns:
String the text.

getText

public String getText()
Returns the readable text like "VERYHIGH","HIGH" etc.


getText

public String getText(Locale locale)
Return the Display text for this enum type. If the text can not be found in the resource bundle The enum key is returned.

Parameters:
locale - - Locale can be null in which the default locale will be used.
Returns:

toString

public String toString()
Returns:
String the text.
See Also:
Object.toString()

equals

public boolean equals(Object obj)
Parameters:
obj - the object that needs to be compared against "this".
Returns:
boolean true if the priorities are the same and false otherwise.
See Also:
Object.equals(java.lang.Object)

getEnumFromInt

public static PriorityEnum getEnumFromInt(int val)
Parameters:
val - the value of priority in the form of an integer.
Returns:
PriorityEnum that matches the value. If the value is less than zero or greater than equal to MAX, returns UNDEFINED but not null.

getEnumFromKey

public static PriorityEnum getEnumFromKey(String key)
Parameters:
key - that specifies the priority.
Returns:
PriorityEnum matches the key. If the key cannot be found in the map of priorities, return UNDEFINED.

compareTo

public int compareTo(Object arg)
This method compares the priorities based on this and arg. If arg is not an instance of PriorityEnum, this method returns 0 indicating equality instead of throwing ClassCastException.

Specified by:
compareTo in interface Comparable
Parameters:
arg - the object that needs to be compared against this.
Returns:
int 1 if this.value is greater than arg.value. Similarly, returns -1 if it is other way round. Returns 0 if they are equal or if arg is not an instance of PriorityEnum.
See Also:
Comparable.compareTo(java.lang.Object)


Copyright 2006 SAP AG Complete Copyright Notice