TMap

trait TMap[A, B] extends TxnDebuggable

A transactional map implementation that requires that all of its map-like operations be called from inside an atomic block. Rather than extending Map, an implicit conversion is provided from TMap to Map if the current scope is part of an atomic block (see TMap.asMap).

A transactional map implementation that requires that all of its map-like operations be called from inside an atomic block. Rather than extending Map, an implicit conversion is provided from TMap to Map if the current scope is part of an atomic block (see TMap.asMap).

The keys (with type A) must be immutable, or at least not modified while they are in the map. The TMap implementation assumes that it can safely perform key equality and hash checks outside a transaction without affecting atomicity.

Authors

Nathan Bronson

Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def apply(key: A)(txn: InTxn): B
def contains(key: A)(txn: InTxn): Boolean
def filterInPlace(p: (A, B) => Boolean)(txn: InTxn): TMap[A, B]
def foreach[U](f: (A, B) => U)(txn: InTxn): Unit
def get(key: A)(txn: InTxn): Option[B]
def isEmpty(txn: InTxn): Boolean
def mapValuesInPlace(f: (A, B) => B)(txn: InTxn): TMap[A, B]
def put(key: A, value: B)(txn: InTxn): Option[B]
def remove(key: A)(txn: InTxn): Option[B]
def single: View[A, B]

Returns an instance that provides transactional map functionality without requiring that operations be performed inside the static scope of an atomic block.

Returns an instance that provides transactional map functionality without requiring that operations be performed inside the static scope of an atomic block.

def size(txn: InTxn): Int

Concrete methods

def ++=(kvs: IterableOnce[(A, B)])(txn: InTxn): TMap[A, B]
def +=(kv: (A, B))(txn: InTxn): TMap[A, B]
def --=(ks: IterableOnce[A])(txn: InTxn): TMap[A, B]
def -=(k: A)(txn: InTxn): TMap[A, B]
def clone(txn: InTxn): TMap[A, B]
def snapshot: Map[A, B]
def update(key: A, value: B)(txn: InTxn): Unit

Deprecated methods

@deprecated("use ++=", "0.8")
def +=(kv1: (A, B), kv2: (A, B), kvs: (A, B)*)(txn: InTxn): TMap[A, B]
Deprecated
@deprecated("use --=", "0.8")
def -=(k1: A, k2: A, ks: A*)(txn: InTxn): TMap[A, B]
Deprecated
@deprecated("Use .filterInPlace instead of .retain", "0.8") @inline
final def retain(p: (A, B) => Boolean)(txn: InTxn): TMap[A, B]
Deprecated
@deprecated("Use .mapValuesInPlace instead of .transform", "0.8") @inline
final def transform(f: (A, B) => B)(txn: InTxn): TMap[A, B]
Deprecated

Inherited methods

def dbgStr: String

Returns a string representation of the transactional value in this instance for debugging convenience. The Ref reads (and writes) performed while constructing the result will be discarded before returning. This method works fine outside a transaction.

Returns a string representation of the transactional value in this instance for debugging convenience. The Ref reads (and writes) performed while constructing the result will be discarded before returning. This method works fine outside a transaction.

If this method is called from within a transaction that is already doomed (status Txn.Rolledback), a string describing the reason for the outer transaction's rollback will be returned.

Inherited from
TxnDebuggable
def dbgValue: Any

Returns some value that is suitable for examination in a debugger, or returns a Txn.RollbackCause if called from inside a doomed atomic block.

Returns some value that is suitable for examination in a debugger, or returns a Txn.RollbackCause if called from inside a doomed atomic block.

Inherited from
TxnDebuggable