class ReplicatedSet[E] extends InternalReplicatedData
A Replicated Set that allows both the addition and removal of elements in a set.
A removal can only be done if all of the additions that added the key have been seen by this node. This means that, for example if node 1 adds element A, and node 2 also adds element A, then node 1's addition is replicated to node 3, and node 3 deletes it before node 2's addition is replicated, then the element will still be in the map because node 2's addition had not yet been observed by node 3, and will cause the element to be re-added when node 3 receives it. However, if both * additions had been replicated to node 3, then the element will be removed.
Care needs to be taken to ensure that the serialized value of elements in the set is stable. For example, if using protobufs, the serialized value of any maps contained in the protobuf is not stable, and can yield a different set of bytes for the same logically equal element. Hence maps should be avoided. Additionally, some changes in protobuf schemas which are backwards compatible from a protobuf perspective, such as changing from sint32 to int32, do result in different serialized bytes, and so must be avoided.
- E
The type of elements.
- Source
- ReplicatedSet.scala
- Alphabetic
- By Inheritance
- ReplicatedSet
- InternalReplicatedData
- InternalReplicatedData
- ReplicatedData
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Type Members
- final type Self = ReplicatedSet[E]
- Definition Classes
- ReplicatedSet → InternalReplicatedData
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from ReplicatedSet[E] toany2stringadd[ReplicatedSet[E]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (ReplicatedSet[E], B)
- Implicit
- This member is added by an implicit conversion from ReplicatedSet[E] toArrowAssoc[ReplicatedSet[E]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def add(element: E): ReplicatedSet[E]
Add an element to this set if it is not already present.
Add an element to this set if it is not already present.
- element
element to be added to this set
- returns
a new set with the additional element, or this unchanged set
- def addAll(elements: Iterable[E]): ReplicatedSet[E]
Add elements to this set if they're not already present.
Add elements to this set if they're not already present.
Effectively the union of two sets.
- elements
collection containing elements to be added to this set
- returns
a new set with the additional elements, or this unchanged set
- def apply(element: E): Boolean
Check whether this set contains the given element.
Check whether this set contains the given element.
- element
element whose presence in this set is to be tested
- returns
true
if this set contains the specified element
- final def applyDelta: PartialFunction[Delta, ReplicatedSet[E]]
- Definition Classes
- ReplicatedSet → InternalReplicatedData
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clear(): ReplicatedSet[E]
Remove all elements from this set.
Remove all elements from this set.
- returns
a new empty set
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def containsAll(elements: Iterable[E]): Boolean
Check whether this set contains all the given elements.
Check whether this set contains all the given elements.
- elements
collection to be checked for containment in this set
- returns
true
if this set contains all the given elements
- val delegate: ReplicatedSetImpl[E]
- Definition Classes
- ReplicatedSet → InternalReplicatedData
- def elements: Set[E]
Elements of this set as a regular scala.collection.immutable.Set
Elements of this set as a regular scala.collection.immutable.Set
- returns
elements as scala.collection.immutable.Set
- def ensuring(cond: (ReplicatedSet[E]) => Boolean, msg: => Any): ReplicatedSet[E]
- Implicit
- This member is added by an implicit conversion from ReplicatedSet[E] toEnsuring[ReplicatedSet[E]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (ReplicatedSet[E]) => Boolean): ReplicatedSet[E]
- Implicit
- This member is added by an implicit conversion from ReplicatedSet[E] toEnsuring[ReplicatedSet[E]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): ReplicatedSet[E]
- Implicit
- This member is added by an implicit conversion from ReplicatedSet[E] toEnsuring[ReplicatedSet[E]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): ReplicatedSet[E]
- Implicit
- This member is added by an implicit conversion from ReplicatedSet[E] toEnsuring[ReplicatedSet[E]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def forall(predicate: (E) => Boolean): Boolean
Tests whether a predicate holds for all elements of this ReplicatedSet.
Tests whether a predicate holds for all elements of this ReplicatedSet.
- predicate
the predicate used to test elements.
- returns
true
if this ReplicatedSet is empty or the given predicatepred
holds for all elements of this ReplicatedSet, otherwisefalse
.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDelta: Delta
- Definition Classes
- InternalReplicatedData → InternalReplicatedData
- def hasDelta: Boolean
- Definition Classes
- InternalReplicatedData → InternalReplicatedData
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def isEmpty: Boolean
Check whether this set is empty.
Check whether this set is empty.
- returns
true
if this set contains no elements
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def name: String
- Definition Classes
- InternalReplicatedData → InternalReplicatedData
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def remove(element: E): ReplicatedSet[E]
Remove an element from this set if it is present.
Remove an element from this set if it is present.
- element
element to be removed from this set
- returns
a new set without the removed element, or this unchanged set
- def removeAll(elements: Iterable[E]): ReplicatedSet[E]
Remove elements from this set if they're present.
Remove elements from this set if they're present.
Effectively the asymmetric set difference of two sets.
- elements
collection containing elements to be removed from this set
- returns
a new set without the removed elements, or this unchanged set
- final def resetDelta(): ReplicatedSet[E]
- Definition Classes
- ReplicatedSet → InternalReplicatedData
- def retainAll(elements: Iterable[E]): ReplicatedSet[E]
Retain only the elements that are contained in the given collection.
Retain only the elements that are contained in the given collection.
Effectively the intersection of two sets.
- elements
collection containing elements to be retained in this set
- returns
a new set with the retained elements, or this unchanged set
- def size: Int
Get the number of elements in this set (its cardinality).
Get the number of elements in this set (its cardinality).
- returns
the number of elements in the set
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from ReplicatedSet[E] toStringFormat[ReplicatedSet[E]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def →[B](y: B): (ReplicatedSet[E], B)
- Implicit
- This member is added by an implicit conversion from ReplicatedSet[E] toArrowAssoc[ReplicatedSet[E]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.