com.amx.duet.tools.net.snmp.api
Class SNMPInteger

java.lang.Object
  extended bycom.amx.duet.tools.net.snmp.api.SNMPObject
      extended bycom.amx.duet.tools.net.snmp.api.SNMPInteger
Direct Known Subclasses:
SNMPCounter32, SNMPCounter64, SNMPGauge32, SNMPTimeTicks, SNMPUInteger32

public class SNMPInteger
extends SNMPObject

Defines an arbitrarily-sized integer value; there is no limit on size due to the use of Java.lang.BigInteger to store the value internally. For an indicator which "pegs" at its maximum value if initialized with a larger value, use SNMPGauge32; for a counter which wraps, use SNMPCounter32 or SNMPCounter64.

See Also:
snmp.dr1_0_14.SNMPCounter32, snmp.dr1_0_14.SNMPGauge32, snmp.dr1_0_14.SNMPCounter64

Constructor Summary
SNMPInteger()
          Initialize value to 0.
SNMPInteger(java.math.BigInteger value)
           
SNMPInteger(long value)
           
 
Method Summary
 void extractValueFromBEREncoding(byte[] enc)
          Used to extract a value from the BER encoding of the value.
 java.lang.Object getValue()
          Returns a java.lang.BigInteger object with the current value.
 void setValue(java.lang.Object newValue)
          Used to set the value with an instance of java.lang.Integer or java.lang.BigInteger.
 java.lang.String toString()
          Should return an appropriate human-readable representation of the stored value.
 java.lang.String toString(int radix)
           
 
Methods inherited from class com.amx.duet.tools.net.snmp.api.SNMPObject
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SNMPInteger

public SNMPInteger()
Initialize value to 0.


SNMPInteger

public SNMPInteger(long value)

SNMPInteger

public SNMPInteger(java.math.BigInteger value)
Method Detail

getValue

public java.lang.Object getValue()
Returns a java.lang.BigInteger object with the current value.

Specified by:
getValue in class SNMPObject

setValue

public void setValue(java.lang.Object newValue)
              throws SNMPBadValueException
Used to set the value with an instance of java.lang.Integer or java.lang.BigInteger.

Specified by:
setValue in class SNMPObject
Throws:
SNMPBadValueException - Indicates an incorrect object type supplied.

extractValueFromBEREncoding

public void extractValueFromBEREncoding(byte[] enc)
                                 throws SNMPBadValueException
Used to extract a value from the BER encoding of the value. Called in constructors for SNMPInteger subclasses.

Throws:
SNMPBadValueException - Indicates an invalid BER encoding supplied. Shouldn't occur in normal operation, i.e., when valid responses are received from devices.

toString

public java.lang.String toString()
Description copied from class: SNMPObject
Should return an appropriate human-readable representation of the stored value.

Specified by:
toString in class SNMPObject

toString

public java.lang.String toString(int radix)


Copyright © 2008 AMX LLC. All Rights Reserved.