public final class GridCacheAtomicLongImpl extends Object implements GridCacheAtomicLongEx, Externalizable
| Constructor and Description |
|---|
GridCacheAtomicLongImpl()
Empty constructor required by
Externalizable. |
GridCacheAtomicLongImpl(String name,
GridCacheInternalKey key,
IgniteInternalCache<GridCacheInternalKey,GridCacheAtomicLongValue> atomicView,
GridCacheContext ctx)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
addAndGet(long l)
Adds
l and gets current value of atomic long. |
void |
close()
Removes this atomic long.
|
boolean |
compareAndSet(long expVal,
long newVal)
Atomically compares current value to the expected value, and if they are equal, sets current value
to new value.
|
long |
compareAndSetAndGet(long expVal,
long newVal) |
long |
decrementAndGet()
Decrements and gets current value of atomic long.
|
long |
get()
Gets current value of atomic long.
|
long |
getAndAdd(long l)
Gets current value of atomic long and adds
l. |
long |
getAndDecrement()
Gets and decrements current value of atomic long.
|
long |
getAndIncrement()
Gets and increments current value of atomic long.
|
long |
getAndSet(long l)
Gets current value of atomic long and sets new value
l of atomic long. |
long |
incrementAndGet()
Increments and gets current value of atomic long.
|
GridCacheInternalKey |
key()
Get current atomic long key.
|
String |
name()
Name of atomic long.
|
void |
needCheckNotRemoved() |
boolean |
onRemoved()
Set status of data structure as removed.
|
void |
readExternal(ObjectInput in) |
boolean |
removed()
Gets status of atomic.
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public GridCacheAtomicLongImpl()
Externalizable.public GridCacheAtomicLongImpl(String name, GridCacheInternalKey key, IgniteInternalCache<GridCacheInternalKey,GridCacheAtomicLongValue> atomicView, GridCacheContext ctx)
name - Atomic long name.key - Atomic long key.atomicView - Atomic projection.ctx - CacheContext.public String name()
name in interface IgniteAtomicLongpublic long get()
get in interface IgniteAtomicLongpublic long incrementAndGet()
incrementAndGet in interface IgniteAtomicLongpublic long getAndIncrement()
getAndIncrement in interface IgniteAtomicLongpublic long addAndGet(long l)
l and gets current value of atomic long.addAndGet in interface IgniteAtomicLongl - Number which will be added.public long getAndAdd(long l)
l.getAndAdd in interface IgniteAtomicLongl - Number which will be added.public long decrementAndGet()
decrementAndGet in interface IgniteAtomicLongpublic long getAndDecrement()
getAndDecrement in interface IgniteAtomicLongpublic long getAndSet(long l)
l of atomic long.getAndSet in interface IgniteAtomicLongl - New value of atomic long.public boolean compareAndSet(long expVal,
long newVal)
compareAndSet in interface IgniteAtomicLongexpVal - Expected atomic long's value.newVal - New atomic long's value to set if current value equal to expected value.True if comparison succeeded, false otherwise.public long compareAndSetAndGet(long expVal,
long newVal)
expVal - Expected value.newVal - New value.public boolean onRemoved()
onRemoved in interface GridCacheRemovablepublic void needCheckNotRemoved()
needCheckNotRemoved in interface GridCacheRemovablepublic GridCacheInternalKey key()
key in interface GridCacheAtomicLongExpublic boolean removed()
removed in interface IgniteAtomicLongtrue if atomic was removed from cache, false in other case.public void close()
close in interface Closeableclose in interface AutoCloseableclose in interface IgniteAtomicLongpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundException
Follow @ApacheIgnite
Ignite Fabric : ver. 1.6.0 Release Date : May 18 2016