com.adventnet.snmp.snmp2
Class SnmpCounter
java.lang.Object
|
+--com.adventnet.snmp.snmp2.SnmpVar
|
+--com.adventnet.snmp.snmp2.SnmpUnsignedInt
|
+--com.adventnet.snmp.snmp2.SnmpCounter
- All Implemented Interfaces:
- java.io.Serializable
- public class SnmpCounter
- extends SnmpUnsignedInt
Class of SNMP Counter Variable - Sub-class of SnmpUnsignedInt.
- See Also:
- Serialized Form
Constructor Summary |
SnmpCounter(long s)
Constructor requires a long as its argument. |
Method Summary |
long |
getIncrement(long lastValue)
Gets the (positive) increment of this Counter variable over a long. |
long |
getIncrement(SnmpCounter c)
Gets the (positive) increment of this Counter variable over another. |
java.lang.String |
toTagString()
To convert the object to a printable string tagged with Counter: |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SnmpCounter
public SnmpCounter(long s)
- Constructor requires a long as its argument.
- Parameters:
s
- long value
The valid values ranges from 0 to 4294967295(both inclusive).
toTagString
public java.lang.String toTagString()
- To convert the object to a printable string tagged with Counter:
- Overrides:
toTagString
in class SnmpUnsignedInt
- Returns:
- string tagged with Counter:
getIncrement
public long getIncrement(SnmpCounter c)
- Gets the (positive) increment of this Counter variable over another.
Takes care of wraparound by adding the MAX counter value if negative.
getIncrement
public long getIncrement(long lastValue)
- Gets the (positive) increment of this Counter variable over a long.
Takes care of wraparound by adding the MAX counter value if negative.
Copyright (c)AdventNet Inc., 1996-2004