|
||||||||||
| 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.GammaTxnLong
public class GammaTxnLong
| 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 | |
|---|---|
GammaTxnLong(GammaStm stm)
|
|
GammaTxnLong(GammaStm stm,
long initialValue)
|
|
GammaTxnLong(GammaTxn tx)
|
|
GammaTxnLong(GammaTxn tx,
long value)
|
|
GammaTxnLong(long value)
|
|
| Method Summary | |
|---|---|
long |
alterAndGet(GammaTxn tx,
LongFunction function)
|
long |
alterAndGet(LongFunction function)
Alters the value stored in this Ref using the provided function and returns the result. |
long |
alterAndGet(Txn tx,
LongFunction function)
Alters the value stored in this Ref using the provided function and lifting on the provided txn. |
long |
atomicAlterAndGet(LongFunction function)
Atomically applies the function to the current value in this ref and returns the new value. |
boolean |
atomicCompareAndSet(long expectedValue,
long newValue)
Executes a compare and set atomically. |
long |
atomicGet()
Atomically gets the value. |
long |
atomicGetAndAlter(LongFunction function)
Atomically applies the function to alter the value stored in this ref and returns the old value. |
long |
atomicGetAndIncrement(long amount)
Atomically increments the value and returns the old value. |
long |
atomicGetAndSet(long newValue)
Atomically sets the value and returns the previous value. |
long |
atomicIncrementAndGet(long amount)
Atomically increments the value and returns the old value. |
long |
atomicSet(long 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. |
long |
atomicWeakGet()
Atomically gets the value without providing any ordering guarantees. |
void |
await(GammaTxn tx,
long value)
|
void |
await(GammaTxn tx,
LongPredicate predicate)
|
void |
await(long value)
Awaits for the value to become the given value. |
void |
await(LongPredicate predicate)
Awaits until the predicate holds. |
void |
await(Txn tx,
long value)
Awaits for the reference to become the given value. |
void |
await(Txn tx,
LongPredicate predicate)
Awaits until the predicate holds using the provided txn. |
void |
commute(GammaTxn tx,
LongFunction function)
|
void |
commute(LongFunction function)
Applies the function on the ref in a commuting manner. |
void |
commute(Txn tx,
LongFunction function)
Applies the function on the ref in a commuting manner. |
void |
decrement()
Decrements the value by one. |
void |
decrement(long 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,
long amount)
Decrements the value by the given amount using the provided txn. |
long |
get()
Gets the value using the provided txn. |
long |
get(GammaTxn tx)
|
long |
get(Txn tx)
Gets the value using the provided txn. |
long |
getAndAlter(GammaTxn tx,
LongFunction function)
|
long |
getAndAlter(LongFunction function)
Alters the value stored in this Ref using the provided function amd returns the old value. |
long |
getAndAlter(Txn tx,
LongFunction function)
Alters the value stored in this Ref using the function and returns the old value, using the provided txn. |
long |
getAndIncrement(GammaTxn tx,
long amount)
|
long |
getAndIncrement(long amount)
Increments the value and returns the old value. |
long |
getAndIncrement(Txn tx,
long amount)
Increments the value and returns the old value using the provided txn. |
long |
getAndLock(GammaTxn tx,
LockMode lockMode)
|
long |
getAndLock(LockMode lockMode)
Gets the value and applies the lock. |
long |
getAndLock(Txn tx,
LockMode lockMode)
Gets the value using the provided txn and acquired the lock with the specified LockMode. |
long |
getAndSet(GammaTxn tx,
long value)
|
long |
getAndSet(long value)
Sets the value the value and returns the new value. |
long |
getAndSet(Txn tx,
long value)
Sets the value using the provided txn. |
long |
getAndSetAndLock(long value,
LockMode lockMode)
Sets the value, acquired the Lock with the specified Lockmode and returns the previous value. |
long |
getAndSetAndLock(Txn tx,
long value,
LockMode lockMode)
Sets the value and acquired the Lock with the provided LockMode. |
long |
getAndSetLock(GammaTxn tx,
long value,
LockMode lockMode)
|
void |
increment()
Increments the value by one. |
void |
increment(GammaTxn tx)
|
void |
increment(long 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,
long amount)
Increments the value by the given amount using the provided txn. |
long |
incrementAndGet(GammaTxn tx,
long amount)
|
long |
incrementAndGet(long amount)
Increments and gets the new value. |
long |
incrementAndGet(Txn tx,
long amount)
Increments and gets the new value using the provided txn. |
long |
set(GammaTxn tx,
long value)
|
long |
set(long value)
Sets the new value. |
long |
set(Txn tx,
long value)
Sets the new value using the provided txn. |
long |
setAndLock(GammaTxn tx,
long value,
LockMode lockMode)
|
long |
setAndLock(long value,
LockMode lockMode)
Sets the new value and applies the lock. |
long |
setAndLock(Txn tx,
long 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 GammaTxnLong(long value)
public GammaTxnLong(GammaStm stm)
public GammaTxnLong(GammaStm stm,
long initialValue)
public GammaTxnLong(GammaTxn tx)
public GammaTxnLong(GammaTxn tx,
long value)
| Method Detail |
|---|
public final long get()
TxnLong
get in interface TxnLongTxnLong.atomicGet()public final long get(Txn tx)
TxnLong
get in interface TxnLongtx - the Txn used for this operation.
public final long get(GammaTxn tx)
public final long getAndLock(LockMode lockMode)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
getAndLock in interface TxnLonglockMode - the LockMode applied.
TxnLong.atomicGet()
public final long getAndLock(Txn tx,
LockMode lockMode)
TxnLong
getAndLock in interface TxnLongtx - the Txn used for this operation.lockMode - the LockMode used
public final long getAndLock(GammaTxn tx,
LockMode lockMode)
public final long set(long value)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
set in interface TxnLongvalue - the new value.
public final long set(Txn tx,
long value)
TxnLong
set in interface TxnLongtx - the Txn used for this operation.value - the new value
public final long set(GammaTxn tx,
long value)
public final long setAndLock(long value,
LockMode lockMode)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
setAndLock in interface TxnLongvalue - the new value.lockMode - the used LockMode.
public final long setAndLock(Txn tx,
long value,
LockMode lockMode)
TxnLong
setAndLock in interface TxnLongtx - the Txn used for this operation.value - the new valuelockMode - the lockMode used.
public final long setAndLock(GammaTxn tx,
long value,
LockMode lockMode)
public final long getAndSet(long value)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSet in interface TxnLongvalue - the new value.
public final long getAndSet(Txn tx,
long value)
TxnLong
getAndSet in interface TxnLongtx - the Txn used for this operation.value - the new value.
public final long getAndSet(GammaTxn tx,
long value)
public final long getAndSetAndLock(long value,
LockMode lockMode)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSetAndLock in interface TxnLongvalue - the new value.lockMode - the LockMode used.
public final long getAndSetAndLock(Txn tx,
long value,
LockMode lockMode)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
getAndSetAndLock in interface TxnLongtx - the Txn used for this operation.value - the new value.lockMode - the LockMode used.
public final long getAndSetLock(GammaTxn tx,
long value,
LockMode lockMode)
public final long atomicGet()
TxnLongTxnLong.atomicWeakGet().
atomicGet in interface TxnLongpublic final long atomicWeakGet()
TxnLongIt is the best method to call if you just want to get the current value stored.
atomicWeakGet in interface TxnLongpublic final long atomicSet(long newValue)
TxnLong
atomicSet in interface TxnLongnewValue - the new value.
public final long atomicGetAndSet(long newValue)
TxnLong
atomicGetAndSet in interface TxnLongnewValue - the new value.
public final void commute(LongFunction function)
TxnLongThis 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 TxnLongfunction - the function to apply to this reference.
public final void commute(Txn tx,
LongFunction function)
TxnLongThis 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 TxnLongtx - the Txn used for this operation.function - the function to apply to this reference.
public final void commute(GammaTxn tx,
LongFunction function)
public final long atomicAlterAndGet(LongFunction function)
TxnLong
atomicAlterAndGet in interface TxnLongfunction - the Function used
public final long alterAndGet(LongFunction function)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
alterAndGet in interface TxnLongfunction - the function that alters the value stored in this Ref.
public final long alterAndGet(Txn tx,
LongFunction function)
TxnLong
alterAndGet in interface TxnLongtx - the Txn used for this operation.function - the function that alters the value stored in this Ref.
public final long alterAndGet(GammaTxn tx,
LongFunction function)
public final long atomicGetAndAlter(LongFunction function)
TxnLong
atomicGetAndAlter in interface TxnLongfunction - the Function used
public final long getAndAlter(LongFunction function)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
getAndAlter in interface TxnLongfunction - the function that alters the value stored in this Ref.
public final long getAndAlter(Txn tx,
LongFunction function)
TxnLong
getAndAlter in interface TxnLongtx - the Txn used for this operation.function - the function that alters the value stored in this Ref.
public final long getAndAlter(GammaTxn tx,
LongFunction function)
public final boolean atomicCompareAndSet(long expectedValue,
long newValue)
TxnLong
atomicCompareAndSet in interface TxnLongexpectedValue - the expected value.newValue - the new value.
public final long atomicGetAndIncrement(long amount)
TxnLong
atomicGetAndIncrement in interface TxnLongamount - the amount to increase with.
public final long getAndIncrement(long amount)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
getAndIncrement in interface TxnLongamount - the amount to increment with.
public final long getAndIncrement(Txn tx,
long amount)
TxnLong
getAndIncrement in interface TxnLongtx - the Txn used for this operation.amount - the amount to increment with.
public final long getAndIncrement(GammaTxn tx,
long amount)
public final long atomicIncrementAndGet(long amount)
TxnLong
atomicIncrementAndGet in interface TxnLongamount - the amount to increment with.
public final long incrementAndGet(long amount)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
incrementAndGet in interface TxnLongamount - the amount to increment with.
public final long incrementAndGet(Txn tx,
long amount)
TxnLong
incrementAndGet in interface TxnLongtx - the Txn used for this operation.amount - the amount to increment with.
public final long incrementAndGet(GammaTxn tx,
long amount)
public final void increment()
TxnLongThis 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 TxnLongpublic final void increment(Txn tx)
TxnLongThis 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 TxnLongtx - the Txn used for this operation.public final void increment(GammaTxn tx)
public final void increment(long amount)
TxnLongThis 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 TxnLongamount - the amount to increase with
public final void increment(Txn tx,
long amount)
TxnLongThis 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 TxnLongtx - the Txn used for this operation.amount - the amount to increment withpublic final void decrement()
TxnLongThis 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 TxnLongpublic final void decrement(Txn tx)
TxnLongThis 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 TxnLongtx - the Txn used for this operation.public final void decrement(long amount)
TxnLongThis 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 TxnLongamount - the amount to decrement with
public final void decrement(Txn tx,
long amount)
TxnLongThis 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 TxnLongtx - the Txn used for this operation.amount - the amount to decrement withpublic final void await(long value)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
await in interface TxnLongvalue - the value to wait for.
public final void await(Txn tx,
long value)
TxnLong
await in interface TxnLongtx - the Txn used for this operation.value - the value to wait for.
public final void await(GammaTxn tx,
long value)
public final void await(LongPredicate predicate)
TxnLongThis call lifts on the Txn stored in the TxnThreadLocal.
await in interface TxnLongpredicate - the predicate to evaluate.
public final void await(Txn tx,
LongPredicate predicate)
TxnLong
await in interface TxnLongtx - the Txn used for this operation.predicate - the predicate to evaluate.
public final void await(GammaTxn tx,
LongPredicate 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 | |||||||||