TSet

trait TSet[A] extends TxnDebuggable

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

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

The elements (with type A) must be immutable, or at least not modified while they are in the set. The TSet implementation assumes that it can safely perform 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 add(elem: A)(txn: InTxn): Boolean
def contains(elem: A)(txn: InTxn): Boolean
def filterInPlace(p: A => Boolean)(txn: InTxn): TSet[A]
def foreach[U](f: A => U)(txn: InTxn): Unit
def isEmpty(txn: InTxn): Boolean
def remove(elem: A)(txn: InTxn): Boolean
def single: View[A]

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

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

def size(txn: InTxn): Int

Concrete methods

def ++=(xs: IterableOnce[A])(txn: InTxn): TSet[A]
def +=(x: A)(txn: InTxn): TSet[A]
def --=(xs: IterableOnce[A])(txn: InTxn): TSet[A]
def -=(x: A)(txn: InTxn): TSet[A]
def apply(elem: A)(txn: InTxn): Boolean
def clone(txn: InTxn): TSet[A]
def snapshot: Set[A]
def update(elem: A, included: Boolean)(txn: InTxn): Unit

Deprecated methods

@deprecated("use ++=", "0.8")
def +=(x1: A, x2: A, xs: A*)(txn: InTxn): TSet[A]
Deprecated
@deprecated("use --=", "0.8")
def -=(x1: A, x2: A, xs: A*)(txn: InTxn): TSet[A]
Deprecated
@deprecated("Use .filterInPlace instead of .retain", "0.8") @inline
final def retain(p: A => Boolean)(txn: InTxn): TSet[A]
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