public class GridAtomicInteger extends AtomicInteger
AtomicInteger
.
In addition to operations provided in java atomic data structures, this class also adds greater than and less than atomic set operations.
Constructor and Description |
---|
GridAtomicInteger()
Creates a new AtomicInteger with initial value
0 . |
GridAtomicInteger(int initVal)
Creates a new AtomicInteger with the given initial value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkAndSet(IgnitePredicate<Integer> p,
int update)
Atomically updates value only if passed in predicate returns
true . |
boolean |
greaterAndSet(int check,
int update)
Atomically updates value only if
check value is greater
than current value. |
boolean |
greaterEqualsAndSet(int check,
int update)
Atomically updates value only if
check value is greater
than or equal to current value. |
boolean |
lessAndSet(int check,
int update)
Atomically updates value only if
check value is less
than current value. |
boolean |
lessEqualsAndSet(int check,
int update)
Atomically updates value only if
check value is less
than current value. |
boolean |
setIfGreater(int update)
Sets value only if it is greater than current one.
|
boolean |
setIfGreaterEquals(int update)
Sets value only if it is greater than or equals to current one.
|
boolean |
setIfLess(int update)
Sets value only if it is less than current one.
|
boolean |
setIfLessEquals(int update)
Sets value only if it is less than or equals to current one.
|
boolean |
setIfNotEquals(int update)
Sets value only if it is not equals to current one.
|
addAndGet, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, incrementAndGet, intValue, lazySet, longValue, set, toString, weakCompareAndSet
byteValue, shortValue
public GridAtomicInteger()
0
.public GridAtomicInteger(int initVal)
initVal
- the initial valuepublic boolean greaterAndSet(int check, int update)
check
value is greater
than current value.check
- Value to check against.update
- Value to set.True
if value was set.public boolean greaterEqualsAndSet(int check, int update)
check
value is greater
than or equal to current value.check
- Value to check against.update
- Value to set.True
if value was set.public boolean lessAndSet(int check, int update)
check
value is less
than current value.check
- Value to check against.update
- Value to set.True
if value was set.public boolean lessEqualsAndSet(int check, int update)
check
value is less
than current value.check
- Value to check against.update
- Value to set.True
if value was set.public boolean setIfGreater(int update)
update
- Value to set.True
if value was set.public boolean setIfGreaterEquals(int update)
update
- Value to set.True
if value was set.public boolean setIfLess(int update)
update
- Value to set.True
if value was set.public boolean setIfLessEquals(int update)
update
- Value to set.True
if value was set.public boolean setIfNotEquals(int update)
update
- Value to set.True
if value was set.public boolean checkAndSet(IgnitePredicate<Integer> p, int update)
true
.p
- Predicate to check.update
- Value to set.True
if value was set.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017