public class GridAtomicLong extends AtomicLong
AtomicLong.
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 |
|---|
GridAtomicLong()
Creates a new AtomicLong with initial value
0. |
GridAtomicLong(long initVal)
Creates a new AtomicLong with the given initial value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkAndSet(IgnitePredicate<Long> p,
long update)
Atomically updates value only if passed in predicate returns
true. |
boolean |
greaterAndSet(long check,
long update)
Atomically updates value only if
check value is greater
than current value. |
boolean |
greaterEqualsAndSet(long check,
long update)
Atomically updates value only if
check value is greater
than or equal to current value. |
boolean |
lessAndSet(long check,
long update)
Atomically updates value only if
check value is less
than current value. |
boolean |
lessEqualsAndSet(long check,
long update)
Atomically updates value only if
check value is less
than current value. |
boolean |
setIfGreater(long update)
Sets value only if it is greater than current one.
|
boolean |
setIfGreaterEquals(long update)
Sets value only if it is greater than or equals to current one.
|
boolean |
setIfLess(long update)
Sets value only if it is less than current one.
|
boolean |
setIfLessEquals(long update)
Sets value only if it is less than or equals to current one.
|
boolean |
setIfNotEquals(long 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, weakCompareAndSetbyteValue, shortValuepublic GridAtomicLong()
0.public GridAtomicLong(long initVal)
initVal - the initial valuepublic boolean greaterAndSet(long check,
long 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(long check,
long 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(long check,
long 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(long check,
long 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(long update)
update - Value to set.True if value was set.public boolean setIfGreaterEquals(long update)
update - Value to set.True if value was set.public boolean setIfLess(long update)
update - Value to set.True if value was set.public boolean setIfLessEquals(long update)
update - Value to set.True if value was set.public boolean setIfNotEquals(long update)
update - Value to set.True if value was set.public boolean checkAndSet(IgnitePredicate<Long> p, long update)
true.p - Predicate to check.update - Value to set.True if value was set.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.2.0 Release Date : September 15 2017