public class AtomicNumberClientProxy extends Object implements AtomicNumber
Instance.InstanceType
Constructor and Description |
---|
AtomicNumberClientProxy(HazelcastClient hazelcastClient,
String name) |
Modifier and Type | Method and Description |
---|---|
long |
addAndGet(long delta)
Atomically adds the given value to the current value.
|
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.
|
void |
destroy()
Destroys this instance cluster-wide.
|
long |
get()
Gets the current value.
|
long |
getAndAdd(long delta)
Atomically adds the given value to the current value.
|
long |
getAndSet(long newValue)
Atomically sets the given value and returns the old value.
|
Object |
getId()
Returns the unique id for this instance.
|
Instance.InstanceType |
getInstanceType()
Returns instance type such as map, set, list, lock, topic, multimap, id generator
|
LocalAtomicNumberStats |
getLocalAtomicNumberStats() |
String |
getName()
Returns the name of this IAtomicLong instance.
|
long |
incrementAndGet()
Atomically increments the current value by one.
|
void |
lazySet(long newValue)
Deprecated.
|
void |
set(long newValue)
Atomically sets the given value.
|
boolean |
weakCompareAndSet(long expect,
long update)
Deprecated.
|
public AtomicNumberClientProxy(HazelcastClient hazelcastClient, String name)
public long addAndGet(long delta)
AtomicNumber
addAndGet
in interface AtomicNumber
delta
- the value to addpublic boolean compareAndSet(long expect, long update)
AtomicNumber
==
the expected value.compareAndSet
in interface AtomicNumber
expect
- the expected valueupdate
- the new valuepublic long decrementAndGet()
AtomicNumber
decrementAndGet
in interface AtomicNumber
public long get()
AtomicNumber
get
in interface AtomicNumber
public long getAndAdd(long delta)
AtomicNumber
getAndAdd
in interface AtomicNumber
delta
- the value to addpublic long getAndSet(long newValue)
AtomicNumber
getAndSet
in interface AtomicNumber
newValue
- the new valuepublic long incrementAndGet()
AtomicNumber
incrementAndGet
in interface AtomicNumber
public void set(long newValue)
AtomicNumber
set
in interface AtomicNumber
newValue
- the new valuepublic void destroy()
Instance
public Object getId()
Instance
public Instance.InstanceType getInstanceType()
Instance
getInstanceType
in interface Instance
public String getName()
AtomicNumber
getName
in interface AtomicNumber
@Deprecated public boolean weakCompareAndSet(long expect, long update)
AtomicNumber
weakCompareAndSet
in interface AtomicNumber
@Deprecated public void lazySet(long newValue)
lazySet
in interface AtomicNumber
public LocalAtomicNumberStats getLocalAtomicNumberStats()
getLocalAtomicNumberStats
in interface AtomicNumber
Copyright © 2013 Hazelcast, Inc.. All rights reserved.