com.hazelcast.core
Interface AtomicNumber

All Superinterfaces:
Instance

public interface AtomicNumber
extends Instance

AtomicNumber is a backed-up distributed implementation of java.util.concurrent.atomic.AtomicLong.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.hazelcast.core.Instance
Instance.InstanceType
 
Method Summary
 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.
 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.
 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. 
 
Methods inherited from interface com.hazelcast.core.Instance
destroy, getId, getInstanceType
 

Method Detail

getName

String getName()
Returns the name of this IAtomicLong instance.

Returns:
name of this instance

addAndGet

long addAndGet(long delta)
Atomically adds the given value to the current value.

Parameters:
delta - the value to add
Returns:
the updated value

compareAndSet

boolean compareAndSet(long expect,
                      long update)
Atomically sets the value to the given updated value only if the current value == the expected value.

Parameters:
expect - the expected value
update - the new value
Returns:
true if successful; or false if the actual value was not equal to the expected value.

decrementAndGet

long decrementAndGet()
Atomically decrements the current value by one.

Returns:
the updated value

get

long get()
Gets the current value.

Returns:
the current value

getAndAdd

long getAndAdd(long delta)
Atomically adds the given value to the current value.

Parameters:
delta - the value to add
Returns:
the old value before the add

getAndSet

long getAndSet(long newValue)
Atomically sets the given value and returns the old value.

Parameters:
newValue - the new value
Returns:
the old value

incrementAndGet

long incrementAndGet()
Atomically increments the current value by one.

Returns:
the updated value

set

void set(long newValue)
Atomically sets the given value.

Parameters:
newValue - the new value

weakCompareAndSet

@Deprecated
boolean weakCompareAndSet(long expect,
                                     long update)
Deprecated. 

Not implemented. Use compareAndSet().


lazySet

@Deprecated
void lazySet(long newValue)
Deprecated. 


getLocalAtomicNumberStats

LocalAtomicNumberStats getLocalAtomicNumberStats()


Copyright © 2008-2012 Hazel Ltd. All Rights Reserved.