net.percederberg.mib.type
Class EnumerationType

java.lang.Object
  |
  +--net.percederberg.mib.type.Type
        |
        +--net.percederberg.mib.type.EnumerationType

public class EnumerationType
extends Type

A class for handling integer type information.

Version:
1.0
Author:
Per Cederberg, per@percederberg.net

Constructor Summary
EnumerationType()
          Creates a new enumeration type with no values.
 
Method Summary
 void addValue(java.lang.String label, java.lang.Number value)
          Adds a value to the enumeration of possible values.
 boolean equals(java.lang.Object obj)
          Checks if this type is equal to some other object.
 java.lang.String toString()
          Returns a string description of this type.
 void transferType(TypeConverter converter)
          Transfers the type information from this type to a type converter object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnumerationType

public EnumerationType()
Creates a new enumeration type with no values.

Method Detail

addValue

public void addValue(java.lang.String label,
                     java.lang.Number value)
Adds a value to the enumeration of possible values. If this is the first value to be added, all other constraints will be resetted.

Parameters:
label - the constant name
value - the constant value

equals

public boolean equals(java.lang.Object obj)
Checks if this type is equal to some other object. It will not be reported equal to any other object than itself or named aliases of itself.

Specified by:
equals in class Type
Parameters:
obj - an object
Returns:
true if the objects are equal, or false otherwise

toString

public java.lang.String toString()
Returns a string description of this type.

Specified by:
toString in class Type
Returns:
a string description of the type

transferType

public void transferType(TypeConverter converter)
Transfers the type information from this type to a type converter object. The calling conventions declared in the TypeConverter class are followed.

Specified by:
transferType in class Type
Parameters:
converter - a type converter