public class RedissonAtomicLong extends Object implements RAtomicLong
AtomicLong
Modifier and Type | Method and Description |
---|---|
long |
addAndGet(long delta)
Atomically adds the given value to the current value.
|
void |
close() |
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 |
getAndDecrement()
Atomically decrements by one the current value.
|
long |
getAndIncrement()
Atomically increments the current value by one.
|
long |
getAndSet(long newValue)
Atomically sets the given value and returns the old value.
|
String |
getName() |
long |
incrementAndGet()
Atomically increments the current value by one.
|
void |
init() |
void |
set(long newValue)
Atomically sets the given value.
|
String |
toString() |
public void init()
public long addAndGet(long delta)
RAtomicLong
addAndGet
in interface RAtomicLong
delta
- the value to addpublic boolean compareAndSet(long expect, long update)
RAtomicLong
==
the expected value.compareAndSet
in interface RAtomicLong
expect
- the expected valueupdate
- the new valuepublic long decrementAndGet()
RAtomicLong
decrementAndGet
in interface RAtomicLong
public long get()
RAtomicLong
get
in interface RAtomicLong
public long getAndAdd(long delta)
RAtomicLong
getAndAdd
in interface RAtomicLong
delta
- the value to addpublic long getAndSet(long newValue)
RAtomicLong
getAndSet
in interface RAtomicLong
newValue
- the new valuepublic long incrementAndGet()
RAtomicLong
incrementAndGet
in interface RAtomicLong
public long getAndIncrement()
RAtomicLong
getAndIncrement
in interface RAtomicLong
public long getAndDecrement()
RAtomicLong
getAndDecrement
in interface RAtomicLong
public void set(long newValue)
RAtomicLong
set
in interface RAtomicLong
newValue
- the new valuepublic String getName()
public void close()
Copyright © 2014. All rights reserved.