net.percederberg.mibble.value
Class NumberValue

java.lang.Object
  extended bynet.percederberg.mibble.value.NumberValue
All Implemented Interfaces:
MibValue

public class NumberValue
extends java.lang.Object
implements MibValue

A numeric MIB value.

Since:
2.0

Constructor Summary
NumberValue(java.lang.Number value)
          Creates a new number value.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Checks if this object equals another object.
 int hashCode()
          Returns a hash code for this object.
 MibValue initialize(MibLoaderLog log)
          Initializes the MIB value.
 java.lang.Object toObject()
          Returns a Java Number representation of this value.
 java.lang.String toString()
          Returns a string representation of this value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumberValue

public NumberValue(java.lang.Number value)
Creates a new number value.

Parameters:
value - the number value
Method Detail

initialize

public MibValue initialize(MibLoaderLog log)
Initializes the MIB value. This will remove all levels of indirection present, such as references to other values, and returns the basic value. No value information is lost by this operation. This method may modify this object as a side-effect, and will be called by the MIB loader.

Specified by:
initialize in interface MibValue
Parameters:
log - the MIB loader log
Returns:
the basic MIB value

equals

public boolean equals(java.lang.Object obj)
Checks if this object equals another object. This method will compare the string representations for equality.

Parameters:
obj - the object to compare with
Returns:
true if the objects are equal, or false otherwise

hashCode

public int hashCode()
Returns a hash code for this object.

Returns:
a hash code for this object

toObject

public java.lang.Object toObject()
Returns a Java Number representation of this value.

Specified by:
toObject in interface MibValue
Returns:
a Java Number representation of this value

toString

public java.lang.String toString()
Returns a string representation of this value.

Returns:
a string representation of this value