Package io.vertx.rxjava3.core.shareddata
Class Counter
- java.lang.Object
-
- io.vertx.rxjava3.core.shareddata.Counter
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<Counter>__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.reactivex.rxjava3.core.Single<Long>addAndGet(long value)Add the value to the counter atomically and return the new countio.reactivex.rxjava3.core.Single<Boolean>compareAndSet(long expected, long value)Set the counter to the specified value only if the current value is the expectec value.io.reactivex.rxjava3.core.Single<Long>decrementAndGet()Decrement the counter atomically and return the new countbooleanequals(Object o)io.reactivex.rxjava3.core.Single<Long>get()Get the current value of the counterio.reactivex.rxjava3.core.Single<Long>getAndAdd(long value)Add the value to the counter atomically and return the value before the addio.reactivex.rxjava3.core.Single<Long>getAndIncrement()Increment the counter atomically and return the value before the increment.CountergetDelegate()inthashCode()io.reactivex.rxjava3.core.Single<Long>incrementAndGet()Increment the counter atomically and return the new countstatic CounternewInstance(Counter arg)io.reactivex.rxjava3.core.Single<Long>rxAddAndGet(long value)Add the value to the counter atomically and return the new countio.reactivex.rxjava3.core.Single<Boolean>rxCompareAndSet(long expected, long value)Set the counter to the specified value only if the current value is the expectec value.io.reactivex.rxjava3.core.Single<Long>rxDecrementAndGet()Decrement the counter atomically and return the new countio.reactivex.rxjava3.core.Single<Long>rxGet()Get the current value of the counterio.reactivex.rxjava3.core.Single<Long>rxGetAndAdd(long value)Add the value to the counter atomically and return the value before the addio.reactivex.rxjava3.core.Single<Long>rxGetAndIncrement()Increment the counter atomically and return the value before the increment.io.reactivex.rxjava3.core.Single<Long>rxIncrementAndGet()Increment the counter atomically and return the new countStringtoString()
-
-
-
Method Detail
-
getDelegate
public Counter getDelegate()
-
get
public io.reactivex.rxjava3.core.Single<Long> get()
Get the current value of the counter- Returns:
-
rxGet
public io.reactivex.rxjava3.core.Single<Long> rxGet()
Get the current value of the counter- Returns:
-
incrementAndGet
public io.reactivex.rxjava3.core.Single<Long> incrementAndGet()
Increment the counter atomically and return the new count- Returns:
-
rxIncrementAndGet
public io.reactivex.rxjava3.core.Single<Long> rxIncrementAndGet()
Increment the counter atomically and return the new count- Returns:
-
getAndIncrement
public io.reactivex.rxjava3.core.Single<Long> getAndIncrement()
Increment the counter atomically and return the value before the increment.- Returns:
-
rxGetAndIncrement
public io.reactivex.rxjava3.core.Single<Long> rxGetAndIncrement()
Increment the counter atomically and return the value before the increment.- Returns:
-
decrementAndGet
public io.reactivex.rxjava3.core.Single<Long> decrementAndGet()
Decrement the counter atomically and return the new count- Returns:
-
rxDecrementAndGet
public io.reactivex.rxjava3.core.Single<Long> rxDecrementAndGet()
Decrement the counter atomically and return the new count- Returns:
-
addAndGet
public io.reactivex.rxjava3.core.Single<Long> addAndGet(long value)
Add the value to the counter atomically and return the new count- Parameters:
value- the value to add- Returns:
-
rxAddAndGet
public io.reactivex.rxjava3.core.Single<Long> rxAddAndGet(long value)
Add the value to the counter atomically and return the new count- Parameters:
value- the value to add- Returns:
-
getAndAdd
public io.reactivex.rxjava3.core.Single<Long> getAndAdd(long value)
Add the value to the counter atomically and return the value before the add- Parameters:
value- the value to add- Returns:
-
rxGetAndAdd
public io.reactivex.rxjava3.core.Single<Long> rxGetAndAdd(long value)
Add the value to the counter atomically and return the value before the add- Parameters:
value- the value to add- Returns:
-
compareAndSet
public io.reactivex.rxjava3.core.Single<Boolean> compareAndSet(long expected, long value)
Set the counter to the specified value only if the current value is the expectec value. This happens atomically.- Parameters:
expected- the expected valuevalue- the new value- Returns:
-
rxCompareAndSet
public io.reactivex.rxjava3.core.Single<Boolean> rxCompareAndSet(long expected, long value)
Set the counter to the specified value only if the current value is the expectec value. This happens atomically.- Parameters:
expected- the expected valuevalue- the new value- Returns:
-
-