com.jguild.jrpm.io.constant
Class EnumDelegate

java.lang.Object
  extended bycom.jguild.jrpm.io.constant.EnumDelegate
All Implemented Interfaces:
EnumIf

class EnumDelegate
extends java.lang.Object
implements EnumIf

Abstract Enum class.

Version:
$Id: EnumDelegate.java,v 1.2 2003/10/20 16:32:12 mkuss Exp $

Field Summary
static int _UNKNOWN
           
 
Constructor Summary
EnumDelegate(java.lang.Class refClass, long id, java.lang.String name, EnumIf realEnum)
          Creates a new EnumDelegate object.
 
Method Summary
static boolean containsEnumId(java.lang.Class refClass, java.lang.Long id)
          Check if this enum class contains a enum of a specified id
static EnumIf getEnumById(java.lang.Class refClass, long id)
          Get a enum by id
static EnumIf getEnumByName(java.lang.Class refClass, java.lang.String name)
          Get a enum by name
static java.lang.String[] getEnumNames(java.lang.Class refClass)
          Get all defined enums of this class
 long getId()
          Get the id of this enum object
 java.lang.String getName()
          Get the name of this enum object
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_UNKNOWN

public static final int _UNKNOWN
See Also:
Constant Field Values
Constructor Detail

EnumDelegate

public EnumDelegate(java.lang.Class refClass,
                    long id,
                    java.lang.String name,
                    EnumIf realEnum)
Creates a new EnumDelegate object.

Parameters:
refClass - Referencing class for this enum (the class that implements the enum)
id - A id for this enum
name - A name for this enum
realEnum - The actual reference of the enum object (the real enum object that implements EnumIf)
Method Detail

getEnumById

public static EnumIf getEnumById(java.lang.Class refClass,
                                 long id)
Get a enum by id

Parameters:
refClass - referencing class
id - The id of the enum
Returns:
The enum object

getEnumByName

public static EnumIf getEnumByName(java.lang.Class refClass,
                                   java.lang.String name)
Get a enum by name

Parameters:
refClass - referencing class
name - The name of the enum
Returns:
The enum object

getEnumNames

public static java.lang.String[] getEnumNames(java.lang.Class refClass)
Get all defined enums of this class

Parameters:
refClass - referencing class
Returns:
An array of all defined enum objects

getId

public long getId()
Description copied from interface: EnumIf
Get the id of this enum object

Specified by:
getId in interface EnumIf
Returns:
The id

getName

public java.lang.String getName()
Description copied from interface: EnumIf
Get the name of this enum object

Specified by:
getName in interface EnumIf
Returns:
The name

containsEnumId

public static boolean containsEnumId(java.lang.Class refClass,
                                     java.lang.Long id)
Check if this enum class contains a enum of a specified id

Parameters:
refClass - referencing class
id - The id of the enum
Returns:
TRUE if the enum is defined in this class

toString

public java.lang.String toString()


Copyright © 2002-2005 Sourceforge. All Rights Reserved.