Class SegmentedAtomicInteger
java.lang.Object
java.lang.Number
com.gigaspaces.internal.utils.concurrent.SegmentedAtomicInteger
- All Implemented Interfaces:
Serializable
Provides a segmented counter while the get() returns an accurate result.
- Since:
- 7.1
- Author:
- Guy
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSegmentedAtomicInteger(int initialValue) SegmentedAtomicInteger(int initialValue, int concurrencyLevel) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int delta) intaddAndGet(int delta) voidintdoublefloatintget()voidintintintValue()longvoidreset()Reset the counter in a non atomic fashion, at a quiscient state this method will reset the counter to its initial value, but in a concurrent state, interleaving operations affect is not deterministic and may be overridden or accumulated.Methods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
SegmentedAtomicInteger
public SegmentedAtomicInteger() -
SegmentedAtomicInteger
public SegmentedAtomicInteger(int initialValue) -
SegmentedAtomicInteger
public SegmentedAtomicInteger(int initialValue, int concurrencyLevel)
-
-
Method Details
-
decrement
public void decrement() -
increment
public void increment() -
add
public void add(int delta) -
decrementAndGet
public int decrementAndGet() -
incrementAndGet
public int incrementAndGet() -
addAndGet
public int addAndGet(int delta) -
get
public int get() -
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
intValue
public int intValue() -
longValue
public long longValue() -
reset
public void reset()Reset the counter in a non atomic fashion, at a quiscient state this method will reset the counter to its initial value, but in a concurrent state, interleaving operations affect is not deterministic and may be overridden or accumulated. A normal use would be a reset of statistic counter that the precise accumulation of statistics is not mandatory.
-