Package org.apache.ignite
Interface IgniteAtomicLong
- 
- All Superinterfaces:
- AutoCloseable,- Closeable
 
 public interface IgniteAtomicLong extends Closeable This interface provides a rich API for working with distributedly cached atomic long value.FunctionalityDistributed atomic long includes the following main functionality:- 
 Method get()gets current value of atomic long.
- 
 Various get..(..)methods get current value of atomic long and increase or decrease value of atomic long.
- 
 Method addAndGet(long l)sumslwith current value of atomic long and returns result.
- 
 Method incrementAndGet()increases value of atomic long and returns result.
- 
 Method decrementAndGet()decreases value of atomic long and returns result.
- 
 Method getAndSet(long l)gets current value of atomic long and setslas value of atomic long.
- 
 Method name()gets name of atomic long.
 Creating Distributed Atomic LongInstance of distributed atomic long can be created by calling the following method:- See Also:
- Ignite.atomicLong(String, long, boolean)
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract 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- 
nameString name() Name of atomic long.- Returns:
- Name of atomic long.
 
 - 
getlong get() throws IgniteException Gets current value of atomic long.- Returns:
- Current value of atomic long.
- Throws:
- IgniteException- If operation failed.
 
 - 
incrementAndGetlong incrementAndGet() throws IgniteExceptionIncrements and gets current value of atomic long.- Returns:
- Value.
- Throws:
- IgniteException- If operation failed.
 
 - 
getAndIncrementlong getAndIncrement() throws IgniteExceptionGets and increments current value of atomic long.- Returns:
- Value.
- Throws:
- IgniteException- If operation failed.
 
 - 
addAndGetlong addAndGet(long l) throws IgniteExceptionAddsland gets current value of atomic long.- Parameters:
- l- Number which will be added.
- Returns:
- Value.
- Throws:
- IgniteException- If operation failed.
 
 - 
getAndAddlong getAndAdd(long l) throws IgniteExceptionGets current value of atomic long and addsl.- Parameters:
- l- Number which will be added.
- Returns:
- Value.
- Throws:
- IgniteException- If operation failed.
 
 - 
decrementAndGetlong decrementAndGet() throws IgniteExceptionDecrements and gets current value of atomic long.- Returns:
- Value.
- Throws:
- IgniteException- If operation failed.
 
 - 
getAndDecrementlong getAndDecrement() throws IgniteExceptionGets and decrements current value of atomic long.- Returns:
- Value.
- Throws:
- IgniteException- If operation failed.
 
 - 
getAndSetlong getAndSet(long l) throws IgniteExceptionGets current value of atomic long and sets new valuelof atomic long.- Parameters:
- l- New value of atomic long.
- Returns:
- Value.
- Throws:
- IgniteException- If operation failed.
 
 - 
compareAndSetboolean 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.- 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- If failed.
 
 - 
removedboolean removed() Gets status of atomic.- Returns:
- trueif atomic was removed from cache,- falsein other case.
 
 - 
closevoid close() Removes this atomic long.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IgniteException- If operation failed.
 
 
- 
 
-