Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.jguild.jrpm.io.constant
Class EnumDelegate  view EnumDelegate download EnumDelegate.java

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 $

Nested Class Summary
private  class EnumDelegate.MapEntry
          Inner class to map ids and names of enums
 
Field Summary
static int _UNKNOWN
           
private  long id
           
private static java.util.HashMap map
           
private  java.lang.String name
           
 
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()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

map

private static final java.util.HashMap map

_UNKNOWN

public static final int _UNKNOWN
See Also:
Constant Field Values

name

private java.lang.String name

id

private long id
Constructor Detail

EnumDelegate

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

Method Detail

getEnumById

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


getEnumByName

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


getEnumNames

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


getId

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

Specified by:
getId in interface EnumIf

getName

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

Specified by:
getName in interface EnumIf

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


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).