|
|||||||||
| 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.
| Field Summary | |
(package private) byte[] |
byteValue
|
(package private) static char[] |
hexValues
|
(package private) long[] |
value
|
| Fields inherited from class com.adventnet.snmp.snmp2.SnmpVar |
Type,
varbindErrorVal |
| 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. |
(package private) |
SnmpCounter64(long val)
constructor used by ASN.1 decoder |
|
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. |
(package private) int |
encode(byte[] buff,
int space)
ASN encoder |
boolean |
equals(java.lang.Object obj)
Returns true if both the SnmpCounter64 objects are equal and false otherwise. |
java.lang.String |
getNumericValueAsString()
This method returns the numeric value of the COUNTER64 data type in decimal ( base 10 ) format. |
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 |
|
| Field Detail |
long[] value
byte[] byteValue
static char[] hexValues
| Constructor Detail |
SnmpCounter64(long val)
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.byteArray is nullbyteArray is not of length 8.public SnmpCounter64(java.math.BigInteger val)
| Method Detail |
public java.lang.Object getVarObject()
public java.lang.Object toValue()
public java.math.BigInteger toBigInteger()
public java.lang.String toString()
public java.lang.String toString(int radix)
radix - the radix for which this counter64 object should be
printed.public java.lang.String toTagString()
public long diff(SnmpCounter64 val)
val is null.public long[] counter64Diff(SnmpCounter64 val)
val is null.public byte[] toBytes()
public boolean equals(java.lang.Object obj)
public java.lang.String getNumericValueAsString()
int encode(byte[] buff,
int space)
throws java.lang.ArrayIndexOutOfBoundsException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||