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
Linear Supertypes
InternalReplicatedData, javasdk.impl.replicatedentity.InternalReplicatedData, ReplicatedData, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReplicatedSet
  2. InternalReplicatedData
  3. InternalReplicatedData
  4. ReplicatedData
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final type Self = ReplicatedSet[E]
    Definition Classes
    ReplicatedSet → InternalReplicatedData

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. 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
  4. 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()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. 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

  7. 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

  8. 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

  9. final def applyDelta: PartialFunction[Delta, ReplicatedSet[E]]
    Definition Classes
    ReplicatedSet → InternalReplicatedData
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clear(): ReplicatedSet[E]

    Remove all elements from this set.

    Remove all elements from this set.

    returns

    a new empty set

  12. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  13. 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

  14. val delegate: ReplicatedSetImpl[E]
  15. def elements: Set[E]

    Elements of this set as a regular Set

    Elements of this set as a regular Set

    returns

    elements as Set

  16. 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
  17. 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
  18. 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
  19. 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
  20. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  22. 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 predicate pred holds for all elements of this ReplicatedSet, otherwise false.

  23. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  24. def getDelta: Delta
    Definition Classes
    InternalReplicatedData → InternalReplicatedData
  25. def hasDelta: Boolean
    Definition Classes
    InternalReplicatedData → InternalReplicatedData
  26. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def isEmpty: Boolean

    Check whether this set is empty.

    Check whether this set is empty.

    returns

    true if this set contains no elements

  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. def name: String
    Definition Classes
    InternalReplicatedData → InternalReplicatedData
  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. 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

  34. 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

  35. final def resetDelta(): ReplicatedSet[E]
    Definition Classes
    ReplicatedSet → InternalReplicatedData
  36. 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

  37. 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

  38. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  39. def toString(): String
    Definition Classes
    AnyRef → Any
  40. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  41. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  42. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. 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 of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. 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.

Inherited from InternalReplicatedData

Inherited from javasdk.impl.replicatedentity.InternalReplicatedData

Inherited from ReplicatedData

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromReplicatedSet[E] to any2stringadd[ReplicatedSet[E]]

Inherited by implicit conversion StringFormat fromReplicatedSet[E] to StringFormat[ReplicatedSet[E]]

Inherited by implicit conversion Ensuring fromReplicatedSet[E] to Ensuring[ReplicatedSet[E]]

Inherited by implicit conversion ArrowAssoc fromReplicatedSet[E] to ArrowAssoc[ReplicatedSet[E]]

Ungrouped