|
||||||||||
| 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.GammaTxnInteger
public class GammaTxnInteger
| 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 | |
|---|---|
GammaTxnInteger(GammaStm stm)
|
|
GammaTxnInteger(GammaStm stm,
int value)
|
|
GammaTxnInteger(GammaTxn tx)
|
|
GammaTxnInteger(GammaTxn tx,
int value)
|
|
GammaTxnInteger(int value)
|
|
| Method Summary | |
|---|---|
int |
alterAndGet(GammaTxn tx,
IntFunction function)
|
int |
alterAndGet(IntFunction function)
Alters the value stored in this Ref using the provided function and returns the result. |
int |
alterAndGet(Txn tx,
IntFunction function)
Alters the value stored in this Ref using the provided function and lifting on the provided txn. |
int |
atomicAlterAndGet(IntFunction function)
Atomically applies the function to the current value in this ref and returns the new value. |
boolean |
atomicCompareAndSet(int expectedValue,
int newValue)
Executes a compare and set atomically. |
int |
atomicGet()
Atomically gets the value. |
int |
atomicGetAndAlter(IntFunction function)
Atomically applies the function to alter the value stored in this ref and returns the old value. |
int |
atomicGetAndIncrement(int amount)
Atomically increments the value and returns the old value. |
int |
atomicGetAndSet(int newValue)
Atomically sets the value and returns the previous value. |
int |
atomicIncrementAndGet(int amount)
Atomically increments the value and returns the old value. |
int |
atomicSet(int 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. |
int |
atomicWeakGet()
Atomically gets the value without providing any ordering guarantees. |
void |
await(GammaTxn tx,
int value)
|
void |
await(GammaTxn tx,
IntPredicate predicate)
|
void |
await(int value)
Awaits for the value to become the given value. |
void |
await(IntPredicate predicate)
Awaits until the predicate holds. |
void |
await(Txn tx,
int value)
Awaits for the reference to become the given value. |
void |
await(Txn tx,
IntPredicate predicate)
Awaits until the predicate holds using the provided txn. |
void |
commute(GammaTxn tx,
IntFunction function)
|
void |
commute(IntFunction function)
Applies the function on the ref in a commuting manner. |
void |
commute(Txn tx,
IntFunction function)
Applies the function on the ref in a commuting manner. |
void |
decrement()
Decrements the value by one. |
void |
decrement(int amount)
Decrements the value by the given amount. |
void |
decrement(Txn tx)
Decrements the value by one using the provided txn. |
void |
decrement(Txn tx,
int amount)
Decrements the value by the given amount using the provided txn. |
int |
get()
Gets the value using the provided txn. |
int |
get(GammaTxn tx)
|
int |
get(Txn tx)
Gets the value using the provided txn. |
int |
getAndAlter(GammaTxn tx,
IntFunction function)
|
int |
getAndAlter(IntFunction function)
Alters the value stored in this Ref using the provided function amd returns the old value. |
int |
getAndAlter(Txn tx,
IntFunction function)
Alters the value stored in this Ref using the function and returns the old value, using the provided txn. |
int |
getAndIncrement(GammaTxn tx,
int amount)
|
int |
getAndIncrement(int amount)
Increments the value and returns the old value. |
int |
getAndIncrement(Txn tx,
int amount)
Increments the value and returns the old value using the provided txn. |
int |
getAndLock(GammaTxn tx,
LockMode lockMode)
|
int |
getAndLock(LockMode lockMode)
Gets the value and applies the lock. |
int |
getAndLock(Txn tx,
LockMode lockMode)
Gets the value using the provided txn and acquired the lock with the specified LockMode. |
int |
getAndSet(GammaTxn tx,
int value)
|
int |
getAndSet(int value)
Sets the value the value and returns the new value. |
int |
getAndSet(Txn tx,
int value)
Sets the value using the provided txn. |
int |
getAndSetAndLock(int value,
LockMode lockMode)
Sets the value, acquired the Lock with the specified Lockmode and returns the previous value. |
int |
getAndSetAndLock(Txn tx,
int value,
LockMode lockMode)
Sets the value and acquired the Lock with the provided LockMode. |
int |
getAndSetLock(GammaTxn tx,
int value,
LockMode lockMode)
|
void |
increment()
Increments the value by one. |
void |
increment(GammaTxn tx,
int amount)
|
void |
increment(int amount)
Increments the value by the given amount. |
void |
increment(Txn tx)
Increments the value by one using the provided txn. |
void |
increment(Txn tx,
int amount)
Increments the value by the given amount using the provided txn. |
int |
incrementAndGet(GammaTxn tx,
int amount)
|
int |
incrementAndGet(int amount)
Increments and gets the new value. |
int |
incrementAndGet(Txn tx,
int amount)
Increments and gets the new value using the provided txn. |
int |
set(GammaTxn tx,
int value)
|
int |
set(int value)
Sets the new value. |
int |
set(Txn tx,
int value)
Sets the new value using the provided txn. |
int |
setAndLock(GammaTxn tx,
int value,
LockMode lockMode)
|
int |
setAndLock(int value,
LockMode lockMode)
Sets the new value and applies the lock. |
int |
setAndLock(Txn tx,
int 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 GammaTxnInteger(int value)
public GammaTxnInteger(GammaTxn tx)
public GammaTxnInteger(GammaTxn tx,
int value)
public GammaTxnInteger(GammaStm stm)
public GammaTxnInteger(GammaStm stm,
int value)
| Method Detail |
|---|
public final int get()
TxnInteger
get in interface TxnIntegerTxnInteger.atomicGet()public final int get(Txn tx)
TxnInteger
get in interface TxnIntegertx - the Txn used for this operation.
public final int get(GammaTxn tx)
public int getAndLock(LockMode lockMode)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
getAndLock in interface TxnIntegerlockMode - the LockMode applied.
TxnInteger.atomicGet()
public final int getAndLock(Txn tx,
LockMode lockMode)
TxnInteger
getAndLock in interface TxnIntegertx - the Txn used for this operation.lockMode - the LockMode used
public final int getAndLock(GammaTxn tx,
LockMode lockMode)
public final int set(int value)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
set in interface TxnIntegervalue - the new value.
public final int set(Txn tx,
int value)
TxnInteger
set in interface TxnIntegertx - the Txn used for this operation.value - the new value
public final int set(GammaTxn tx,
int value)
public final int setAndLock(int value,
LockMode lockMode)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
setAndLock in interface TxnIntegervalue - the new value.lockMode - the used LockMode.
public final int setAndLock(Txn tx,
int value,
LockMode lockMode)
TxnInteger
setAndLock in interface TxnIntegertx - the Txn used for this operation.value - the new valuelockMode - the lockMode used.
public final int setAndLock(GammaTxn tx,
int value,
LockMode lockMode)
public final int getAndSet(int value)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSet in interface TxnIntegervalue - the new value.
public final int getAndSet(Txn tx,
int value)
TxnInteger
getAndSet in interface TxnIntegertx - the Txn used for this operation.value - the new value.
public final int getAndSet(GammaTxn tx,
int value)
public final int getAndSetAndLock(int value,
LockMode lockMode)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSetAndLock in interface TxnIntegervalue - the new value.lockMode - the LockMode used.
public final int getAndSetAndLock(Txn tx,
int value,
LockMode lockMode)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSetAndLock in interface TxnIntegertx - the Txn used for this operation.value - the new value.lockMode - the LockMode used.
public final int getAndSetLock(GammaTxn tx,
int value,
LockMode lockMode)
public final int atomicGet()
TxnIntegerTxnInteger.atomicWeakGet().
atomicGet in interface TxnIntegerpublic final int atomicWeakGet()
TxnIntegerIt is the best method to call if you just want to get the current value stored.
atomicWeakGet in interface TxnIntegerpublic final int atomicSet(int newValue)
TxnInteger
atomicSet in interface TxnIntegernewValue - the new value.
public final int atomicGetAndSet(int newValue)
TxnInteger
atomicGetAndSet in interface TxnIntegernewValue - the new value.
public final void commute(IntFunction function)
TxnIntegerThis 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 TxnIntegerfunction - the function to apply to this reference.
public final void commute(Txn tx,
IntFunction function)
TxnIntegerThis 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 TxnIntegertx - the Txn used for this operation.function - the function to apply to this reference.
public final void commute(GammaTxn tx,
IntFunction function)
public final int atomicAlterAndGet(IntFunction function)
TxnInteger
atomicAlterAndGet in interface TxnIntegerfunction - the Function used
public final int atomicGetAndAlter(IntFunction function)
TxnInteger
atomicGetAndAlter in interface TxnIntegerfunction - the Function used
public final int alterAndGet(IntFunction function)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
alterAndGet in interface TxnIntegerfunction - the function that alters the value stored in this Ref.
public final int alterAndGet(Txn tx,
IntFunction function)
TxnInteger
alterAndGet in interface TxnIntegertx - the Txn used for this operation.function - the function that alters the value stored in this Ref.
public final int alterAndGet(GammaTxn tx,
IntFunction function)
public final int getAndAlter(IntFunction function)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
getAndAlter in interface TxnIntegerfunction - the function that alters the value stored in this Ref.
public final int getAndAlter(Txn tx,
IntFunction function)
TxnInteger
getAndAlter in interface TxnIntegertx - the Txn used for this operation.function - the function that alters the value stored in this Ref.
public final int getAndAlter(GammaTxn tx,
IntFunction function)
public final boolean atomicCompareAndSet(int expectedValue,
int newValue)
TxnInteger
atomicCompareAndSet in interface TxnIntegerexpectedValue - the expected value.newValue - the new value.
public final int atomicGetAndIncrement(int amount)
TxnInteger
atomicGetAndIncrement in interface TxnIntegeramount - the amount to increase with.
public final int atomicIncrementAndGet(int amount)
TxnInteger
atomicIncrementAndGet in interface TxnIntegeramount - the amount to increment with.
public final int getAndIncrement(int amount)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
getAndIncrement in interface TxnIntegeramount - the amount to increment with.
public final int getAndIncrement(Txn tx,
int amount)
TxnInteger
getAndIncrement in interface TxnIntegertx - the Txn used for this operation.amount - the amount to increment with.
public final int getAndIncrement(GammaTxn tx,
int amount)
public final int incrementAndGet(int amount)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
incrementAndGet in interface TxnIntegeramount - the amount to increment with.
public final int incrementAndGet(Txn tx,
int amount)
TxnInteger
incrementAndGet in interface TxnIntegertx - the Txn used for this operation.amount - the amount to increment with.
public final int incrementAndGet(GammaTxn tx,
int amount)
public final void increment()
TxnIntegerThis call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
This call lifts on the Txn stored in the TxnThreadLocal.
increment in interface TxnIntegerpublic final void increment(Txn tx)
TxnIntegerThis call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
increment in interface TxnIntegertx - the Txn used for this operation.public final void increment(int amount)
TxnIntegerThis call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
This call lifts on the Txn stored in the TxnThreadLocal.
increment in interface TxnIntegeramount - the amount to increase with
public final void increment(Txn tx,
int amount)
TxnIntegerThis call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
increment in interface TxnIntegertx - the Txn used for this operation.amount - the amount to increment with
public final void increment(GammaTxn tx,
int amount)
public final void decrement()
TxnIntegerThis call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
This call lifts on the Txn stored in the TxnThreadLocal.
decrement in interface TxnIntegerpublic final void decrement(Txn tx)
TxnIntegerThis call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
decrement in interface TxnIntegertx - the Txn used for this operation.public final void decrement(int amount)
TxnIntegerThis call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
This call lifts on the Txn stored in the TxnThreadLocal.
decrement in interface TxnIntegeramount - the amount to decrement with
public final void decrement(Txn tx,
int amount)
TxnIntegerThis call is able to commute if there are no dependencies on the value in the txn. That is why this method doesn't have a return value.
decrement in interface TxnIntegertx - the Txn used for this operation.amount - the amount to decrement withpublic final void await(int value)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
await in interface TxnIntegervalue - the value to wait for.
public final void await(Txn tx,
int value)
TxnInteger
await in interface TxnIntegertx - the Txn used for this operation.value - the value to wait for.
public final void await(GammaTxn tx,
int value)
public final void await(IntPredicate predicate)
TxnIntegerThis call lifts on the Txn stored in the TxnThreadLocal.
await in interface TxnIntegerpredicate - the predicate to evaluate.
public final void await(Txn tx,
IntPredicate predicate)
TxnInteger
await in interface TxnIntegertx - the Txn used for this operation.predicate - the predicate to evaluate.
public final void await(GammaTxn tx,
IntPredicate 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 | |||||||||