|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.stms.gamma.transactionalobjects.AbstractGammaObject
org.multiverse.stms.gamma.transactionalobjects.BaseGammaTxnRef
org.multiverse.stms.gamma.transactionalobjects.GammaTxnBoolean
public class GammaTxnBoolean
A TxnBoolean for the GammaStm.
| Field Summary |
|---|
| Fields inherited from class org.multiverse.stms.gamma.transactionalobjects.BaseGammaTxnRef |
|---|
long_value, ref_value, type |
| Fields inherited from class org.multiverse.stms.gamma.transactionalobjects.AbstractGammaObject |
|---|
___unsafe, identityHashCode, listeners, listenersOffset, MASK_OREC_EXCLUSIVELOCK, MASK_OREC_READBIASED, MASK_OREC_READLOCKS, MASK_OREC_READONLY_COUNT, MASK_OREC_SURPLUS, MASK_OREC_UPDATELOCK, orec, stm, valueOffset, version |
| Fields inherited from interface org.multiverse.MultiverseConstants |
|---|
LOCKMODE_EXCLUSIVE, LOCKMODE_NONE, LOCKMODE_READ, LOCKMODE_WRITE, SHAKE_BUGS, SPIN_YIELD, TRACING_ENABLED |
| Constructor Summary | |
|---|---|
GammaTxnBoolean(boolean value)
|
|
GammaTxnBoolean(GammaStm stm)
|
|
GammaTxnBoolean(GammaStm stm,
boolean b)
|
|
GammaTxnBoolean(GammaTxn tx)
|
|
GammaTxnBoolean(GammaTxn tx,
boolean value)
|
|
| Method Summary | |
|---|---|
boolean |
alter(GammaTxn tx,
BooleanFunction function,
boolean returnOld)
|
boolean |
alterAndGet(BooleanFunction function)
Alters the value stored in this Ref using the provided function and returns the result. |
boolean |
alterAndGet(GammaTxn tx,
BooleanFunction function)
|
boolean |
alterAndGet(Txn tx,
BooleanFunction function)
Alters the value stored in this Ref using the provided function and lifting on the provided txn. |
boolean |
atomicAlterAndGet(BooleanFunction function)
Atomically applies the function to the current value in this ref and returns the new value. |
boolean |
atomicCompareAndSet(boolean expectedValue,
boolean newValue)
Executes a compare and set atomically. |
boolean |
atomicGet()
Atomically gets the value. |
boolean |
atomicGetAndAlter(BooleanFunction function)
Atomically applies the function to alter the value stored in this ref and returns the old value. |
boolean |
atomicGetAndSet(boolean newValue)
Atomically sets the value and returns the previous value. |
boolean |
atomicSet(boolean newValue)
Atomically sets the value and returns the new value. |
String |
atomicToString()
Returns a String representation of the object using the provided transaction without looking at a TxnThreadLocal. |
boolean |
atomicWeakGet()
Atomically gets the value without providing any ordering guarantees. |
void |
await(boolean value)
Awaits for the value to become the given value. |
void |
await(BooleanPredicate predicate)
Awaits until the predicate holds. |
void |
await(GammaTxn tx,
boolean value)
|
void |
await(GammaTxn tx,
BooleanPredicate predicate)
|
void |
await(Txn tx,
boolean value)
Awaits for the reference to become the given value. |
void |
await(Txn tx,
BooleanPredicate predicate)
Awaits until the predicate holds using the provided txn. |
void |
commute(BooleanFunction function)
Applies the function on the ref in a commuting manner. |
void |
commute(GammaTxn tx,
BooleanFunction function)
|
void |
commute(Txn tx,
BooleanFunction function)
Applies the function on the ref in a commuting manner. |
boolean |
get()
Gets the value using the provided txn. |
boolean |
get(GammaTxn tx)
|
boolean |
get(Txn tx)
Gets the value using the provided txn. |
boolean |
getAndAlter(BooleanFunction function)
Alters the value stored in this Ref using the provided function amd returns the old value. |
boolean |
getAndAlter(GammaTxn tx,
BooleanFunction function)
|
boolean |
getAndAlter(Txn tx,
BooleanFunction function)
Alters the value stored in this Ref using the function and returns the old value, using the provided txn. |
boolean |
getAndLock(GammaTxn tx,
LockMode lockMode)
|
boolean |
getAndLock(LockMode lockMode)
Gets the value and applies the lock. |
boolean |
getAndLock(Txn tx,
LockMode lockMode)
Gets the value using the provided txn and acquired the lock with the specified LockMode. |
boolean |
getAndSet(boolean value)
Sets the value the value and returns the new value. |
boolean |
getAndSet(GammaTxn tx,
boolean value)
|
boolean |
getAndSet(Txn tx,
boolean value)
Sets the value using the provided txn. |
boolean |
getAndSetAndLock(boolean value,
LockMode lockMode)
Sets the value, acquired the Lock with the specified Lockmode and returns the previous value. |
boolean |
getAndSetAndLock(GammaTxn tx,
boolean value,
LockMode lockMode)
|
boolean |
getAndSetAndLock(Txn tx,
boolean value,
LockMode lockMode)
Sets the value and acquired the Lock with the provided LockMode. |
boolean |
set(boolean value)
Sets the new value. |
boolean |
set(GammaTxn tx,
boolean value)
|
boolean |
set(Txn tx,
boolean value)
Sets the new value using the provided txn. |
boolean |
setAndLock(boolean value,
LockMode lockMode)
Sets the new value and applies the lock. |
boolean |
setAndLock(GammaTxn tx,
boolean value,
LockMode lockMode)
|
boolean |
setAndLock(Txn tx,
boolean value,
LockMode lockMode)
Sets the new value using the provided txn. |
String |
toDebugString()
Returns a debug representation of the TxnObject. |
String |
toString()
Returns a String representation of the Object using the Txn on the TxnThreadLocal. |
String |
toString(GammaTxn tx)
|
String |
toString(Txn tx)
Returns a String representation of the object using the provided Txn. |
| Methods inherited from class org.multiverse.stms.gamma.transactionalobjects.BaseGammaTxnRef |
|---|
acquire, acquire, acquire, arriveAndExclusiveLockOrBackoff, atomicCompareAndSetLong, atomicGetLong, atomicObjectGet, atomicSetLong, atomicSetObject, commit, ensure, ensure, ensure, flattenCommute, getLong, getObject, hasReadConflict, leanCommit, load, openForCommute, openForCommute, openForCommute, openForCommute, openForConstruction, openForConstruction, openForConstruction, openForConstruction, openForRead, openForRead, openForRead, openForRead, openForRead, openForRead, openForWrite, openForWrite, openForWrite, openForWrite, openForWrite, openForWrite, prepare, registerChangeListener, releaseAfterFailure, releaseAfterReading, releaseAfterUpdate, setLong, setObject, tryLockAndCheckConflict |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.multiverse.api.TxnObject |
|---|
ensure, ensure, getLock, getStm, getVersion |
| Constructor Detail |
|---|
public GammaTxnBoolean(boolean value)
public GammaTxnBoolean(GammaTxn tx)
public GammaTxnBoolean(GammaTxn tx,
boolean value)
public GammaTxnBoolean(GammaStm stm)
public GammaTxnBoolean(GammaStm stm,
boolean b)
| Method Detail |
|---|
public final boolean get()
TxnBoolean
get in interface TxnBooleanTxnBoolean.atomicGet()public final boolean get(Txn tx)
TxnBoolean
get in interface TxnBooleantx - the Txn used for this operation.
public final boolean get(GammaTxn tx)
public final boolean getAndLock(LockMode lockMode)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
getAndLock in interface TxnBooleanlockMode - the LockMode applied.
TxnBoolean.atomicGet()
public final boolean getAndLock(Txn tx,
LockMode lockMode)
TxnBoolean
getAndLock in interface TxnBooleantx - the Txn used for this operation.lockMode - the LockMode used
public final boolean getAndLock(GammaTxn tx,
LockMode lockMode)
public final boolean set(boolean value)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
set in interface TxnBooleanvalue - the new value.
public final boolean set(Txn tx,
boolean value)
TxnBoolean
set in interface TxnBooleantx - the Txn used for this operation.value - the new value
public final boolean set(GammaTxn tx,
boolean value)
public final boolean setAndLock(boolean value,
LockMode lockMode)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
setAndLock in interface TxnBooleanvalue - the new value.lockMode - the used LockMode.
public final boolean setAndLock(Txn tx,
boolean value,
LockMode lockMode)
TxnBoolean
setAndLock in interface TxnBooleantx - the Txn used for this operation.value - the new valuelockMode - the lockMode used.
public final boolean setAndLock(GammaTxn tx,
boolean value,
LockMode lockMode)
public final boolean getAndSet(boolean value)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSet in interface TxnBooleanvalue - the new value.
public final boolean getAndSet(Txn tx,
boolean value)
TxnBoolean
getAndSet in interface TxnBooleantx - the Txn used for this operation.value - the new value.
public final boolean getAndSetAndLock(boolean value,
LockMode lockMode)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSetAndLock in interface TxnBooleanvalue - the new value.lockMode - the LockMode used.
public final boolean getAndSetAndLock(Txn tx,
boolean value,
LockMode lockMode)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSetAndLock in interface TxnBooleantx - the Txn used for this operation.value - the new value.lockMode - the LockMode used.
public final boolean getAndSetAndLock(GammaTxn tx,
boolean value,
LockMode lockMode)
public final boolean getAndSet(GammaTxn tx,
boolean value)
public final boolean atomicGet()
TxnBooleanTxnBoolean.atomicWeakGet().
atomicGet in interface TxnBooleanpublic final boolean atomicWeakGet()
TxnBooleanIt is the best method to call if you just want to get the current value stored.
atomicWeakGet in interface TxnBooleanpublic final boolean atomicSet(boolean newValue)
TxnBoolean
atomicSet in interface TxnBooleannewValue - the new value.
public final boolean atomicGetAndSet(boolean newValue)
TxnBoolean
atomicGetAndSet in interface TxnBooleannewValue - the new value.
public final void commute(BooleanFunction function)
TxnBooleanThis is different than the behavior in Clojure where the commute will be re-applied at the end of the txn, even though some dependency is introduced, which can lead to inconsistencies.
This call lifts on the Txn stored in the TxnThreadLocal.
commute in interface TxnBooleanfunction - the function to apply to this reference.
public final void commute(Txn tx,
BooleanFunction function)
TxnBooleanThis is different than the behavior in Clojure where the commute will be re-applied at the end of the txn, even though some dependency is introduced, which can lead to inconsistencies.
This call lifts on the Txn stored in the TxnThreadLocal.
commute in interface TxnBooleantx - the Txn used for this operation.function - the function to apply to this reference.
public final void commute(GammaTxn tx,
BooleanFunction function)
public final boolean getAndAlter(BooleanFunction function)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
getAndAlter in interface TxnBooleanfunction - the function that alters the value stored in this Ref.
public final boolean getAndAlter(Txn tx,
BooleanFunction function)
TxnBoolean
getAndAlter in interface TxnBooleantx - the Txn used for this operation.function - the function that alters the value stored in this Ref.
public final boolean getAndAlter(GammaTxn tx,
BooleanFunction function)
public final boolean alterAndGet(BooleanFunction function)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
alterAndGet in interface TxnBooleanfunction - the function that alters the value stored in this Ref.
public final boolean alterAndGet(Txn tx,
BooleanFunction function)
TxnBoolean
alterAndGet in interface TxnBooleantx - the Txn used for this operation.function - the function that alters the value stored in this Ref.
public final boolean alterAndGet(GammaTxn tx,
BooleanFunction function)
public final boolean alter(GammaTxn tx,
BooleanFunction function,
boolean returnOld)
public final boolean atomicAlterAndGet(BooleanFunction function)
TxnBoolean
atomicAlterAndGet in interface TxnBooleanfunction - the Function used
public final boolean atomicGetAndAlter(BooleanFunction function)
TxnBoolean
atomicGetAndAlter in interface TxnBooleanfunction - the Function used
public final boolean atomicCompareAndSet(boolean expectedValue,
boolean newValue)
TxnBoolean
atomicCompareAndSet in interface TxnBooleanexpectedValue - the expected value.newValue - the new value.
public final void await(boolean value)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
await in interface TxnBooleanvalue - the value to wait for.
public final void await(Txn tx,
boolean value)
TxnBoolean
await in interface TxnBooleantx - the Txn used for this operation.value - the value to wait for.
public final void await(GammaTxn tx,
boolean value)
public final void await(BooleanPredicate predicate)
TxnBooleanThis call lifts on the Txn stored in the TxnThreadLocal.
await in interface TxnBooleanpredicate - the predicate to evaluate.
public final void await(Txn tx,
BooleanPredicate predicate)
TxnBoolean
await in interface TxnBooleantx - the Txn used for this operation.predicate - the predicate to evaluate.
public final void await(GammaTxn tx,
BooleanPredicate predicate)
public final String toDebugString()
TxnObject
toDebugString in interface TxnObjectpublic final String toString()
TxnObjectTxn on the TxnThreadLocal.
toString in interface TxnObjecttoString in class Objectpublic final String toString(Txn tx)
TxnObjectTxn.
toString in interface TxnObjecttx - the Txn used.
public final String toString(GammaTxn tx)
public final String atomicToString()
TxnObjectTxnThreadLocal. The outputted value doesn't need to be consistent from some point
in time, only a best effort is made.
atomicToString in interface TxnObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||