oracle.panama.util
Class Enum

java.lang.Object
  |
  +--oracle.panama.util.Enum
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ArgumentType, RendererSelection, SortRule

public abstract class Enum
extends java.lang.Object
implements java.io.Serializable

The abstract enum datatype. This is a helper to implement enumerated datatypes.

Example of Usage:

Create a class Mode which is an enumerated datatype.

 public class Mode extends Enum {
   private static final Mode[] ENUM = {
       new Mode(1, "EXCLUSIVE"),
       new Mode(2, "SUPERVISOR"),
       new Mode(3, "USER"),
   };

   public static final Mode EXCLUSIVE  = ENUM[0];
   public static final Mode SUPERVISOR = ENUM[1];
   public static final Mode USER       = ENUM[2];

    protected Mode(int enum, String value) {
       super(enum, value);
   }

    protected Enum[] getEnum() {
       return ENUM;
   }
 }
 

Since:
PANAMA_10
See Also:
Serialized Form

Method Summary
TypeMethod
 boolean equals(java.lang.Object obj)
           
 int intValue()
          Get the integer value of this enum.
 java.lang.String toString()
          Get the string value of this enum.
 Enum valueOf(int enum)
          Get the Enum for this enum int value.
 Enum valueOf(java.lang.String value)
          Get the enum for this value.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

valueOf

public Enum valueOf(java.lang.String value)
Get the enum for this value.
Returns:
the Enum corresponding to this value or null if not found.

valueOf

public Enum valueOf(int enum)
Get the Enum for this enum int value.
Returns:
the Enum corresponding to this enum or null if not found.

intValue

public int intValue()
Get the integer value of this enum.
Returns:
the int value of this enum.

toString

public java.lang.String toString()
Get the string value of this enum.
Overrides:
toString in class java.lang.Object
Returns:
the String value of this enum.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object