Class ClientAtomicLongImpl
- java.lang.Object
-
- org.apache.ignite.internal.client.thin.ClientAtomicLongImpl
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ClientAtomicLong
public class ClientAtomicLongImpl extends Object implements ClientAtomicLong
Client atomic long.
-
-
Constructor Summary
Constructors Constructor Description ClientAtomicLongImpl(String name, @Nullable String groupName, org.apache.ignite.internal.client.thin.ReliableChannel ch)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longaddAndGet(long l)Addsland gets current value of atomic long.voidclose()Removes this atomic long.booleancompareAndSet(long expVal, long newVal)Atomically compares current value to the expected value, and if they are equal, sets current value to new value.longdecrementAndGet()Decrements and gets current value of atomic long.longget()Gets current value of atomic long.longgetAndAdd(long l)Gets current value of atomic long and addsl.longgetAndDecrement()Gets and decrements current value of atomic long.longgetAndIncrement()Gets and increments current value of atomic long.longgetAndSet(long l)Gets current value of atomic long and sets new valuelof atomic long.longincrementAndGet()Increments and gets current value of atomic long.Stringname()Name of atomic long.booleanremoved()Gets status of atomic.
-
-
-
Method Detail
-
name
public String name()
Name of atomic long.- Specified by:
namein interfaceClientAtomicLong- Returns:
- Name of atomic long.
-
get
public long get() throws IgniteExceptionGets current value of atomic long.- Specified by:
getin interfaceClientAtomicLong- Returns:
- Current value of atomic long.
- Throws:
IgniteException
-
incrementAndGet
public long incrementAndGet() throws IgniteExceptionIncrements and gets current value of atomic long.- Specified by:
incrementAndGetin interfaceClientAtomicLong- Returns:
- Value.
- Throws:
IgniteException
-
getAndIncrement
public long getAndIncrement() throws IgniteExceptionGets and increments current value of atomic long.- Specified by:
getAndIncrementin interfaceClientAtomicLong- Returns:
- Value.
- Throws:
IgniteException
-
addAndGet
public long addAndGet(long l) throws IgniteExceptionAddsland gets current value of atomic long.- Specified by:
addAndGetin interfaceClientAtomicLong- Parameters:
l- Number which will be added.- Returns:
- Value.
- Throws:
IgniteException
-
getAndAdd
public long getAndAdd(long l) throws IgniteExceptionGets current value of atomic long and addsl.- Specified by:
getAndAddin interfaceClientAtomicLong- Parameters:
l- Number which will be added.- Returns:
- Value.
- Throws:
IgniteException
-
decrementAndGet
public long decrementAndGet() throws IgniteExceptionDecrements and gets current value of atomic long.- Specified by:
decrementAndGetin interfaceClientAtomicLong- Returns:
- Value.
- Throws:
IgniteException
-
getAndDecrement
public long getAndDecrement() throws IgniteExceptionGets and decrements current value of atomic long.- Specified by:
getAndDecrementin interfaceClientAtomicLong- Returns:
- Value.
- Throws:
IgniteException
-
getAndSet
public long getAndSet(long l) throws IgniteExceptionGets current value of atomic long and sets new valuelof atomic long.- Specified by:
getAndSetin interfaceClientAtomicLong- Parameters:
l- New value of atomic long.- Returns:
- Value.
- Throws:
IgniteException
-
compareAndSet
public boolean compareAndSet(long expVal, long newVal) throws IgniteExceptionAtomically compares current value to the expected value, and if they are equal, sets current value to new value.- Specified by:
compareAndSetin interfaceClientAtomicLong- Parameters:
expVal- Expected atomic long's value.newVal- New atomic long's value to set if current value equal to expected value.- Returns:
Trueif comparison succeeded,falseotherwise.- Throws:
IgniteException
-
removed
public boolean removed()
Gets status of atomic.- Specified by:
removedin interfaceClientAtomicLong- Returns:
trueif atomic was removed from cache,falsein other case.
-
close
public void close()
Removes this atomic long.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceClientAtomicLong- Specified by:
closein interfaceCloseable
-
-