Package com.storedobject.common
Class Condition
java.lang.Object
java.util.concurrent.atomic.AtomicBoolean
com.storedobject.common.Condition
- All Implemented Interfaces:
Serializable
The Condition class extends AtomicBoolean and provides
utility methods to manage a boolean state that can be used
to signify whether a condition is met or not.
- Author:
- Syam
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newConditionobject with an initial value oftrue. -
Method Summary
Methods inherited from class java.util.concurrent.atomic.AtomicBoolean
compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, get, getAcquire, getAndSet, getOpaque, getPlain, lazySet, set, setOpaque, setPlain, setRelease, toString, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
Constructor Details
-
Condition
public Condition()Constructs a newConditionobject with an initial value oftrue. This constructor initializes the internal state of theConditionto signify that the condition is initially met.
-
-
Method Details
-
ok
public boolean ok()Checks the current state of the condition.- Returns:
trueif the condition is met, otherwisefalse.
-
stop
public void stop()Updates the internal state to indicate that the condition is no longer met. This method sets the state of thisConditiontofalse.
-