Class LocalAtomicBoolean
java.lang.Object
com.oracle.coherence.concurrent.atomic.LocalAtomicBoolean
- All Implemented Interfaces:
AtomicBoolean
Local implementation of
AtomicBoolean
interface, that simply wraps java.util.concurrent.atomic.AtomicBoolean instance.- Since:
- 21.12
- Author:
- Aleks Seovic 2020.12.07
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.oracle.coherence.concurrent.atomic.AtomicBoolean
AtomicBoolean.Serializer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLocalAtomicBoolean(boolean fValue) ConstructLocalAtomicBooleaninstance.protectedLocalAtomicBoolean(AtomicBoolean fValue) ConstructLocalAtomicBooleaninstance. -
Method Summary
Modifier and TypeMethodDescriptionasync()Return non-blocking API for this atomic value.booleancompareAndExchange(boolean fExpectedValue, boolean fNewValue) Atomically sets the value tonewValueif the current value, referred to as the witness value,== expectedValue.booleancompareAndSet(boolean fExpectedValue, boolean fNewValue) Atomically sets the value tonewValueif the current value== expectedValue.booleanget()Returns the current value.booleangetAndSet(boolean fNewValue) Atomically sets the value tonewValueand returns the old value.voidset(boolean fNewValue) Sets the value tonewValue.toString()
-
Constructor Details
-
LocalAtomicBoolean
protected LocalAtomicBoolean(boolean fValue) ConstructLocalAtomicBooleaninstance.- Parameters:
fValue- initial value
-
LocalAtomicBoolean
ConstructLocalAtomicBooleaninstance.- Parameters:
fValue- wrapped value
-
-
Method Details
-
async
Description copied from interface:AtomicBooleanReturn non-blocking API for this atomic value.- Specified by:
asyncin interfaceAtomicBoolean- Returns:
- non-blocking API for this atomic value
-
get
public boolean get()Description copied from interface:AtomicBooleanReturns the current value.- Specified by:
getin interfaceAtomicBoolean- Returns:
- the current value
-
set
public void set(boolean fNewValue) Description copied from interface:AtomicBooleanSets the value tonewValue.- Specified by:
setin interfaceAtomicBoolean- Parameters:
fNewValue- the new value
-
getAndSet
public boolean getAndSet(boolean fNewValue) Description copied from interface:AtomicBooleanAtomically sets the value tonewValueand returns the old value.- Specified by:
getAndSetin interfaceAtomicBoolean- Parameters:
fNewValue- the new value- Returns:
- the previous value
-
compareAndSet
public boolean compareAndSet(boolean fExpectedValue, boolean fNewValue) Description copied from interface:AtomicBooleanAtomically sets the value tonewValueif the current value== expectedValue.- Specified by:
compareAndSetin interfaceAtomicBoolean- Parameters:
fExpectedValue- the expected valuefNewValue- the new value- Returns:
trueif successful. False return indicates that the actual value was not equal to the expected value.
-
compareAndExchange
public boolean compareAndExchange(boolean fExpectedValue, boolean fNewValue) Description copied from interface:AtomicBooleanAtomically sets the value tonewValueif the current value, referred to as the witness value,== expectedValue.- Specified by:
compareAndExchangein interfaceAtomicBoolean- Parameters:
fExpectedValue- the expected valuefNewValue- the new value- Returns:
- the witness value, which will be the same as the expected value if successful
-
toString
-