public abstract class

Enumerated

extends Object
implements Serializable
java.lang.Object
   ↳ com.sun.jmx.snmp.Enumerated
Known Direct Subclasses

Class Overview

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

This API is a Sun Microsystems internal API and is subject to change without notice.

Summary

Fields
protected int value This variable keeps the integer form of the enumerated.
Public Constructors
Enumerated()
Construct an enumerated with a default value.
Enumerated(int valueIndex)
Construct an enumerated from its integer form.
Enumerated(Integer valueIndex)
Construct an enumerated from its Integer form.
Enumerated(String valueString)
Construct an enumerated from its string form.
Public Methods
boolean equals(Object obj)
Compares this enumerated to the specified enumerated.
int hashCode()
Returns the hash code for this enumerated.
int intValue()
Return the integer form of the enumerated.
String toString()
Returns the string form of this enumerated.
Enumeration valueIndexes()
Returns an Java enumeration of the permitted integers.
Enumeration valueStrings()
Returns an Java enumeration of the permitted strings.
Protected Methods
abstract Hashtable getIntTable()
Returns the hashtable of the integer forms.
abstract Hashtable getStringTable()
Returns the hashtable of the string forms.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected int value

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

Public Constructors

public Enumerated ()

Construct an enumerated with a default value. The default value is the first available in getIntTable().

Throws
IllegalArgumentException One of the arguments passed to the method is illegal or inappropriate.

public Enumerated (int valueIndex)

Construct an enumerated from its integer form.

Parameters
valueIndex The integer form.
Throws
IllegalArgumentException One of the arguments passed to the method is illegal or inappropriate.

public Enumerated (Integer valueIndex)

Construct an enumerated from its Integer form.

Parameters
valueIndex The Integer form.
Throws
IllegalArgumentException One of the arguments passed to the method is illegal or inappropriate.

public Enumerated (String valueString)

Construct an enumerated from its string form.

Parameters
valueString The string form.
Throws
IllegalArgumentException One of the arguments passed to the method is illegal or inappropriate.

Public Methods

public boolean equals (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

public int hashCode ()

Returns the hash code for this enumerated.

Returns
  • A hash code value for this object.

public int intValue ()

Return the integer form of the enumerated.

Returns
  • The integer form

public String toString ()

Returns the string form of this enumerated.

Returns
  • The string for for this object.

public Enumeration valueIndexes ()

Returns an Java enumeration of the permitted integers.

Returns
  • An enumeration of Integer instances

public Enumeration valueStrings ()

Returns an Java enumeration of the permitted strings.

Returns
  • An enumeration of String instances

Protected Methods

protected abstract 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

protected abstract 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