final case class GSet[A](elements: Set[A]) extends ReplicatedData with ReplicatedDataSerialization with FastMerge with Product with Serializable
Implements a 'Add Set' CRDT, also called a 'G-Set'. You can't remove elements of a G-Set.
It is described in the paper A comprehensive study of Convergent and Commutative Replicated Data Types.
A G-Set doesn't accumulate any garbage apart from the elements themselves.
This class is immutable, i.e. "modifying" methods return a new instance.
- Annotations
- @SerialVersionUID()
- Source
- GSet.scala
Linear Supertypes
Type Hierarchy
Ordering
- Alphabetic
- By Inheritance
Inherited
- GSet
- Product
- Equals
- FastMerge
- ReplicatedDataSerialization
- Serializable
- Serializable
- ReplicatedData
- AnyRef
- Any
Implicitly
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
- new GSet(elements: Set[A])
Type Members
-
type
T = GSet[A]
The type of the concrete implementation, e.g.
The type of the concrete implementation, e.g.
GSet[A]
. To be specified by subclass.- Definition Classes
- GSet → ReplicatedData
Value Members
-
def
+(element: A): GSet[A]
Adds an element to the set
-
def
add(element: A): GSet[A]
Adds an element to the set
- def contains(a: A): Boolean
- val elements: Set[A]
-
def
getElements(): Set[A]
Java API
- def isEmpty: Boolean
-
def
merge(that: GSet[A]): GSet[A]
Monotonic merge function.
Monotonic merge function.
- Definition Classes
- GSet → ReplicatedData
- def size: Int