com.jniwrapper.util
Class Enums

java.lang.Object
  extended by com.jniwrapper.util.Enums

public class Enums
extends java.lang.Object

Enums is a utility class that allows to retrieve enumeration from a class implementing the enumeration pattern using constants of the type EnumItem.

NOTE: Introduction of native enumeration support in JDK1.5 will make this functionality obsolete.


Constructor Summary
Enums()
           
 
Method Summary
static EnumItem getItem(java.lang.Class enumerationClass, int value)
          Looks up an enumeration item for the specified value and returns an element that corresponds to the passed value.
static java.util.List getItems(java.lang.Class enumerationClass)
          Returns enumeration definition as the list of all public static final members of the type EnumItem defined in the passed class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Enums

public Enums()
Method Detail

getItem

public static EnumItem getItem(java.lang.Class enumerationClass,
                               int value)
Looks up an enumeration item for the specified value and returns an element that corresponds to the passed value.

Parameters:
enumerationClass - a class containing enumeration items.
value - a value of the enumeration element.
Returns:
enumeration item instance.

getItems

public static java.util.List getItems(java.lang.Class enumerationClass)
Returns enumeration definition as the list of all public static final members of the type EnumItem defined in the passed class.

Parameters:
enumerationClass - a class that implements enumeration pattern.
Returns:
a list of enumeration items.