Package org.redisson.api
Interface RAtomicDouble
- All Superinterfaces:
RAtomicDoubleAsync
,RExpirable
,RExpirableAsync
,RObject
,RObjectAsync
- All Known Implementing Classes:
RedissonAtomicDouble
Distributed implementation to the AtomicDouble
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptiondouble
addAndGet
(double delta) Atomically adds the given value to the current value.int
addListener
(ObjectListener listener) Adds object event listenerboolean
compareAndSet
(double expect, double update) Atomically sets the value to the given updated value only if the current value==
the expected value.double
Atomically decrements the current value by one.double
get()
Returns current value.double
getAndAdd
(double delta) Atomically adds the given value to the current value.double
Atomically decrements by one the current value.double
Returns and deletes objectdouble
Atomically increments the current value by one.double
getAndSet
(double newValue) Atomically sets the given value and returns the old value.double
Atomically increments the current value by one.void
set
(double newValue) Atomically sets the given value.boolean
setIfGreater
(double greater, double value) Atomically sets the given value if current value is greater than the special valueboolean
setIfLess
(double less, double value) Atomically sets the given value if current value is less than the special valueMethods inherited from interface org.redisson.api.RAtomicDoubleAsync
addAndGetAsync, addListenerAsync, compareAndSetAsync, decrementAndGetAsync, getAndAddAsync, getAndDecrementAsync, getAndDeleteAsync, getAndIncrementAsync, getAndSetAsync, getAsync, incrementAndGetAsync, setAsync, setIfGreaterAsync, setIfLessAsync
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RObject
copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
Methods inherited from interface org.redisson.api.RObjectAsync
copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
getAndDecrement
double getAndDecrement()Atomically decrements by one the current value.- Returns:
- the previous value
-
addAndGet
double addAndGet(double delta) Atomically adds the given value to the current value.- Parameters:
delta
- the value to add- Returns:
- the updated value
-
compareAndSet
boolean compareAndSet(double expect, double update) Atomically sets the value to the given updated value only if the current value==
the expected value.- Parameters:
expect
- the expected valueupdate
- the new value- Returns:
- true if successful; or false if the actual value was not equal to the expected value.
-
decrementAndGet
double decrementAndGet()Atomically decrements the current value by one.- Returns:
- the updated value
-
get
double get()Returns current value.- Returns:
- current value
-
getAndDelete
double getAndDelete()Returns and deletes object- Returns:
- the current value
-
getAndAdd
double getAndAdd(double delta) Atomically adds the given value to the current value.- Parameters:
delta
- the value to add- Returns:
- the old value before the add
-
getAndSet
double getAndSet(double newValue) Atomically sets the given value and returns the old value.- Parameters:
newValue
- the new value- Returns:
- the old value
-
incrementAndGet
double incrementAndGet()Atomically increments the current value by one.- Returns:
- the updated value
-
getAndIncrement
double getAndIncrement()Atomically increments the current value by one.- Returns:
- the old value
-
set
void set(double newValue) Atomically sets the given value.- Parameters:
newValue
- the new value
-
setIfLess
boolean setIfLess(double less, double value) Atomically sets the given value if current value is less than the special value- Parameters:
less
- compare valuevalue
- newValue- Returns:
- true when the value update is successful
-
setIfGreater
boolean setIfGreater(double greater, double value) Atomically sets the given value if current value is greater than the special value- Parameters:
greater
- compare valuevalue
- newValue- Returns:
- true when the value update is successful
-
addListener
Adds object event listener- Specified by:
addListener
in interfaceRObject
- Parameters:
listener
- object event listener- Returns:
- listener id
- See Also:
-