Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.management
Class Enumerated

    java.lang.Object
      |
      +--com.sun.management.Enumerated

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

This class is used for implementing enumerated values. An enumeration is represented by a class derived from Enumerated. The derived class defines what are the permitted values in the enumeration. An enumerated value is represented by an instance of the derived class. It can be represented : - as an integer - as a string

See Also:
  Serialized Form

Field Summary
`protected int` | `value` This variable keeps the integer form of the enumerated.

Constructor Summary
`Enumerated()` Construct an enumerated with a default value.
`Enumerated(int valueIndex)` Construct an enumerated from its integer form.
`Enumerated(java.lang.Integer valueIndex)` Construct an enumerated from its Integer form.
`Enumerated(java.lang.String valueString)` Construct an enumerated from its string form.

Method Summary
`boolean` | `equals(java.lang.Object obj)` Compares this enumerated to the specified enumerated.
`protected abstract java.util.Hashtable` | `getIntTable()` Returns the hashtable of the integer forms.
`protected abstract java.util.Hashtable` | `getStringTable()` Returns the hashtable of the string forms.
`int` | `hashCode()` Returns the hash code for this enumerated.
`int` | `intValue()` Return the integer form of the enumerated.
`java.lang.String` | `toString()` Returns the string form of this enumerated.
`java.util.Enumeration` | `valueIndexes()` Returns an Java enumeration of the permitted integers.
`java.util.Enumeration` | `valueStrings()` Returns an Java enumeration of the permitted strings.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### value

    protected int value

  This variable keeps the integer form of the enumerated. The string form is retreived using getIntTable().

Constructor Detail

### Enumerated

    public Enumerated()
               throws java.lang.IllegalArgumentException

  Construct an enumerated with a default value. The default value is the first available in getIntTable().
  Throws:
    java.lang.IllegalArgumentException - One of the arguments passed to the method is illegal or inappropriate.

### Enumerated

    public Enumerated(int valueIndex)
               throws java.lang.IllegalArgumentException

  Construct an enumerated from its integer form.
  Parameters:
    `valueIndex` - The integer form.
  Throws:
    java.lang.IllegalArgumentException - One of the arguments passed to the method is illegal or inappropriate.

### Enumerated

    public Enumerated(java.lang.Integer valueIndex)
               throws java.lang.IllegalArgumentException

  Construct an enumerated from its Integer form.
  Parameters:
    `valueIndex` - The Integer form.
  Throws:
    java.lang.IllegalArgumentException - One of the arguments passed to the method is illegal or inappropriate.

### Enumerated

    public Enumerated(java.lang.String valueString)
               throws java.lang.IllegalArgumentException

  Construct an enumerated from its string form.
  Parameters:
    `valueString` - The string form.
  Throws:
    java.lang.IllegalArgumentException - One of the arguments passed to the method is illegal or inappropriate.

Method Detail

### intValue

    public int intValue()

  Return the integer form of the enumerated.
  Returns:
    The integer form

### valueIndexes

    public java.util.Enumeration valueIndexes()

  Returns an Java enumeration of the permitted integers.
  Returns:
    An enumeration of Integer instances

### valueStrings

    public java.util.Enumeration valueStrings()

  Returns an Java enumeration of the permitted strings.
  Returns:
    An enumeration of String instances

### equals

    public boolean equals(java.lang.Object obj)

  Compares this enumerated to the specified enumerated. The result is true if and only if the argument is not null and is of the same class.
  Parameters:
    `obj` - The object to compare with.
  Returns:
    True if this and obj are the same; false otherwise
  Overrides:
    equals in class java.lang.Object

### hashCode

    public int hashCode()

  Returns the hash code for this enumerated.
  Returns:
    A hash code value for this object.
  Overrides:
    hashCode in class java.lang.Object

### toString

    public java.lang.String toString()

  Returns the string form of this enumerated.
  Returns:
    The string for for this object.
  Overrides:
    toString in class java.lang.Object

### getIntTable

    protected abstract java.util.Hashtable getIntTable()

  Returns the hashtable of the integer forms. getIntTable().get(x) returns the string form associated to the integer x. This method must be implemented by the derived class.
  Returns:
    An hashtable for read-only purpose

### getStringTable

    protected abstract java.util.Hashtable getStringTable()

  Returns the hashtable of the string forms. getStringTable().get(s) returns the integer form associated to the string s. This method must be implemented by the derived class.
  Returns:
    An hashtable for read-only purpose

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD