|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.adventnet.snmp.snmp2.SnmpVar | +--com.adventnet.snmp.snmp2.SnmpCounter64
Class of SNMP 64 bit COUNTER Variable. Since Java does not have a 64 bit unsigned type, the data is stored as long array of size 2.
Constructor Summary | |
SnmpCounter64(java.math.BigInteger val)
The constructor takes a BigInteger as its argument. |
|
SnmpCounter64(byte[] byteArray)
This constructor takes a byte array as argument. |
|
SnmpCounter64(long[] val)
The constructor takes a long array of dimension 2 as its argument. |
Method Summary | |
long[] |
counter64Diff(SnmpCounter64 val)
Returns the difference between two SnmpCounter64 numbers as a long array of length 2. |
long |
diff(SnmpCounter64 val)
Returns the difference between this SnmpCounter64 and SnmpCounter64 argument as a long. |
boolean |
equals(java.lang.Object obj)
Returns true if both the SnmpCounter64 objects are equal and false otherwise. |
java.lang.Object |
getVarObject()
returns the value of SNMP variable as an object(long array of length 2). |
java.math.BigInteger |
toBigInteger()
returns the value of SNMP variable as a BigInteger. |
byte[] |
toBytes()
returns the value as raw bytes. |
java.lang.String |
toString()
To convert the object to a printable string used in printing variables. |
java.lang.String |
toString(int radix)
To convert the object to a printable string based on the radix provided. |
java.lang.String |
toTagString()
converts the object to a printable string tagged with COUNTER64: |
java.lang.Object |
toValue()
returns the value of SNMP variable as an object(long array of length 2). |
Methods inherited from class com.adventnet.snmp.snmp2.SnmpVar |
createVariable, getError, getType, getTypeString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SnmpCounter64(long[] val)
public SnmpCounter64(byte[] byteArray)
For Example:
If the value of counter64 is 0xba12345f then the byteArray should
contain
byteArray[0] = 0x00;
byteArray[1] = 0x00;
byteArray[2] = 0x00;
byteArray[3] = 0x00;
byteArray[4] = 0xba;
byteArray[5] = 0x12;
byteArray[6] = 0x34;
byteArray[7] = 0x5f;
From this byteArray the long array would be constructed. The constructed
long array will have the following values in it
longArray[1] = 0x00000000;
longArray[1] = 0xab12345f;
byteArray
- the counter 64 value as an array of bytes of length 8.java.lang.NullPointerException
- if byteArray
is nulljava.lang.IllegalArgumentException
- if byteArray
is not of length 8.public SnmpCounter64(java.math.BigInteger val)
Method Detail |
public java.lang.Object getVarObject()
getVarObject
in class SnmpVar
com.adventnet.snmp.snmp2.SnmpVar
public java.lang.Object toValue()
toValue
in class SnmpVar
com.adventnet.snmp.snmp2.SnmpVar
public java.math.BigInteger toBigInteger()
public java.lang.String toString()
toString
in class SnmpVar
com.adventnet.snmp.snmp2.SnmpVar
public java.lang.String toString(int radix)
radix
- the radix for which this counter64 object should be
printed.public java.lang.String toTagString()
toTagString
in class SnmpVar
com.adventnet.snmp.snmp2.SnmpVar
public long diff(SnmpCounter64 val)
java.lang.NullPointerException
- if val
is null.public long[] counter64Diff(SnmpCounter64 val)
java.lang.NullPointerException
- if val
is null.public byte[] toBytes()
toBytes
in class SnmpVar
com.adventnet.snmp.snmp2.SnmpVar
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |