public class ClientAtomicLongProxy extends ClientProxy implements IAtomicLong
Constructor and Description |
---|
ClientAtomicLongProxy(String serviceName,
String objectId) |
Modifier and Type | Method and Description |
---|---|
long |
addAndGet(long delta)
Atomically adds the given value to the current value.
|
void |
alter(IFunction<Long,Long> function)
Alters the currently stored value by applying a function on it.
|
long |
alterAndGet(IFunction<Long,Long> function)
Alters the currently stored value by applying a function on it and gets the result.
|
<R> R |
apply(IFunction<Long,R> function)
Applies a function on the value, the actual stored value will not change.
|
boolean |
compareAndSet(long expect,
long update)
Atomically sets the value to the given updated value
only if the current value
== the expected value. |
long |
decrementAndGet()
Atomically decrements the current value by one.
|
long |
get()
Gets the current value.
|
long |
getAndAdd(long delta)
Atomically adds the given value to the current value.
|
long |
getAndAlter(IFunction<Long,Long> function)
Alters the currently stored value by applying a function on it on and gets the old value.
|
long |
getAndIncrement()
Atomically increments the current value by one.
|
long |
getAndSet(long newValue)
Atomically sets the given value and returns the old value.
|
long |
incrementAndGet()
Atomically increments the current value by one.
|
protected <T> T |
invoke(ClientRequest req) |
void |
set(long newValue)
Atomically sets the given value.
|
String |
toString() |
destroy, equals, getContext, getId, getName, getPartitionKey, getServiceName, hashCode, invoke, invoke, invokeInterruptibly, listen, listen, onDestroy, onInitialize, onShutdown, setContext, stopListening, throwExceptionIfNull, toData, toObject
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getName
destroy, getId, getPartitionKey, getServiceName
public <R> R apply(IFunction<Long,R> function)
IAtomicLong
apply
in interface IAtomicLong
function
- the function applied to the value, the value is not changedpublic void alter(IFunction<Long,Long> function)
IAtomicLong
alter
in interface IAtomicLong
function
- the function applied to the currently stored valuepublic long alterAndGet(IFunction<Long,Long> function)
IAtomicLong
alterAndGet
in interface IAtomicLong
function
- the function applied to the currently stored valuepublic long getAndAlter(IFunction<Long,Long> function)
IAtomicLong
getAndAlter
in interface IAtomicLong
function
- the function applied to the currently stored valuepublic long addAndGet(long delta)
IAtomicLong
addAndGet
in interface IAtomicLong
delta
- the value to add to the current valuepublic boolean compareAndSet(long expect, long update)
IAtomicLong
==
the expected value.compareAndSet
in interface IAtomicLong
expect
- the expected valueupdate
- the new valuepublic long decrementAndGet()
IAtomicLong
decrementAndGet
in interface IAtomicLong
public long get()
IAtomicLong
get
in interface IAtomicLong
public long getAndAdd(long delta)
IAtomicLong
getAndAdd
in interface IAtomicLong
delta
- the value to add to the current valuepublic long getAndSet(long newValue)
IAtomicLong
getAndSet
in interface IAtomicLong
newValue
- the new valuepublic long incrementAndGet()
IAtomicLong
incrementAndGet
in interface IAtomicLong
public long getAndIncrement()
IAtomicLong
getAndIncrement
in interface IAtomicLong
public void set(long newValue)
IAtomicLong
set
in interface IAtomicLong
newValue
- the new valueprotected <T> T invoke(ClientRequest req)
invoke
in class ClientProxy
Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.