policyMgmt
Class Counter64
java.lang.Object
|
+--policyMgmt.Counter64
- public class Counter64
- extends java.lang.Object
64bit Counter. Is clever enough to remember the current as well as
the previous state of the observed variable. Gives easy access to
the delta between them. Wraps wil produce reasonable values.
|
Method Summary |
int |
compareTo(long value)
Compare this counter to a long value. |
long |
getLowDelta()
Return a 63-bit representation of the current delta. |
long |
getLowValue()
Return a 63-bit representation of the current value. |
void |
increment(long delta)
Add delta to the current state of the object. |
void |
upate(long newValue)
Set the counter to the new value without touching delta
information. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Counter64
public Counter64()
upate
public void upate(long newValue)
- Set the counter to the new value without touching delta
information. May be used for initialization only.
- Parameters:
newValue - the new value
increment
public void increment(long delta)
- Add delta to the current state of the object. Handle wrapping.
- Parameters:
delta - the value to add
getLowValue
public long getLowValue()
- Return a 63-bit representation of the current value.
- Returns:
- the current value
getLowDelta
public long getLowDelta()
- Return a 63-bit representation of the current delta.
- Returns:
- the last delta value
compareTo
public int compareTo(long value)
- Compare this counter to a long value.
- Parameters:
value - the reference value- Returns:
- 0, on equal; -1, if arg > counter; 1, if arg < counter