Interface Counter
-
- All Superinterfaces:
java.lang.Comparable
,DistributedDataStructure
,Lockable
,Notifiable
public interface Counter extends java.lang.Comparable, DistributedDataStructure, Notifiable
This interface contains methods and parameters for Distributed Counter.
-
-
Field Summary
Fields Modifier and Type Field Description static long
_value
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
decrement()
Decrement the value of distributed counter by one.long
decrementBy(long value)
Decrement the value of distributed counter by the amount specified.long
getValue()
Gets the value of counter.long
increment()
Increment the value of distributed counter by one.long
incrementBy(long value)
Increment the value of distributed counter by the amount specified.long
setValue(long value)
Sets the given value of the counter.-
Methods inherited from interface com.alachisoft.ncache.client.datastructures.DistributedDataStructure
getKey, getWriteThruOptions, setWriteThruOptions
-
Methods inherited from interface com.alachisoft.ncache.client.datastructures.Notifiable
addChangeListener, removeChangeListener
-
-
-
-
Field Detail
-
_value
static final long _value
- See Also:
- Constant Field Values
-
-
Method Detail
-
setValue
long setValue(long value)
Sets the given value of the counter.- Parameters:
value
- value to be assigned to the counter.- Returns:
- Current value of the counter.
-
getValue
long getValue()
Gets the value of counter.- Returns:
- Current value of the counter.
-
increment
long increment()
Increment the value of distributed counter by one.- Returns:
- Current value of the counter.
-
decrement
long decrement()
Decrement the value of distributed counter by one.- Returns:
- Current value of the counter.
-
incrementBy
long incrementBy(long value)
Increment the value of distributed counter by the amount specified.- Parameters:
value
- The value to increment by.- Returns:
- Current value of the counter.
-
decrementBy
long decrementBy(long value)
Decrement the value of distributed counter by the amount specified.- Parameters:
value
- The value to decrement by.- Returns:
- Current value of the counter.
-
-