Class GSet<A>

    • Method Detail

      • empty

        public static <A> GSet<A> empty()
      • apply

        public static GSet<java.lang.Object> apply()
      • apply

        public static <A> GSet<A> apply​(scala.collection.immutable.Set<A> set)
      • create

        public static <A> GSet<A> create()
        Java API
        Returns:
        (undocumented)
      • apply

        public static <A> GSet<A> apply​(scala.collection.immutable.Set<A> elements,
                                        scala.Option<GSet<A>> delta)
        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.

        Parameters:
        elements - (undocumented)
        delta - (undocumented)
        Returns:
        (undocumented)
      • unapply

        public static <A> scala.Option<scala.collection.immutable.Set<A>> unapply​(GSet<A> x$0)
      • akka$cluster$ddata$FastMerge$$ancestor

        public static FastMerge akka$cluster$ddata$FastMerge$$ancestor()
      • akka$cluster$ddata$FastMerge$$ancestor_$eq

        public static void akka$cluster$ddata$FastMerge$$ancestor_$eq​(FastMerge x$1)
      • assignAncestor

        public static FastMerge assignAncestor​(akka.cluster.ddata.ReplicatedData.T newData)
      • isAncestorOf

        public static boolean isAncestorOf​(akka.cluster.ddata.ReplicatedData.T that)
      • clearAncestor

        public static FastMerge clearAncestor()
      • elements

        public scala.collection.immutable.Set<A> elements()
      • delta

        public scala.Option<GSet<A>> delta()
        Description copied from interface: DeltaReplicatedData
        The accumulated delta of mutator operations since previous DeltaReplicatedData.resetDelta(). When the Replicator invokes the modify function of the Update message and the user code is invoking one or more mutator operations the data is collecting the delta of the operations and makes it available for the Replicator with the DeltaReplicatedData.delta() accessor. The modify function shall still return the full state in the same way as ReplicatedData without support for deltas.
        Specified by:
        delta in interface DeltaReplicatedData
        Returns:
        (undocumented)
      • getElements

        public java.util.Set<A> getElements()
        Java API
        Returns:
        (undocumented)
      • contains

        public boolean contains​(A a)
      • isEmpty

        public boolean isEmpty()
      • size

        public int size()
      • $plus

        public GSet<A> $plus​(A element)
        Adds an element to the set
        Parameters:
        element - (undocumented)
        Returns:
        (undocumented)
      • add

        public GSet<A> add​(A element)
        Adds an element to the set
        Parameters:
        element - (undocumented)
        Returns:
        (undocumented)
      • mergeDelta

        public GSet<A> mergeDelta​(GSet<A> thatDelta)
      • zero

        public GSet<A> zero()
        Description copied from interface: ReplicatedDelta
        The empty full state. This is used when a delta is received and no existing full state exists on the receiving side. Then the delta is merged into the zero to create the initial full state.
        Specified by:
        zero in interface ReplicatedDelta
        Returns:
        (undocumented)
      • resetDelta

        public GSet<A> resetDelta()
        Description copied from interface: DeltaReplicatedData
        Reset collection of deltas from mutator operations. When the Replicator invokes the modify function of the Update message the delta is always "reset" and when the user code is invoking one or more mutator operations the data is collecting the delta of the operations and makes it available for the Replicator with the DeltaReplicatedData.delta() accessor. When the Replicator has grabbed the delta it will invoke this method to get a clean data instance without the delta.
        Specified by:
        resetDelta in interface DeltaReplicatedData
        Returns:
        (undocumented)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • copy

        public GSet<A> copy​(scala.collection.immutable.Set<A> e)
      • copy$default$1

        public scala.collection.immutable.Set<A> copy$default$1()
      • productPrefix

        public java.lang.String productPrefix()
        Specified by:
        productPrefix in interface scala.Product
      • productArity

        public int productArity()
        Specified by:
        productArity in interface scala.Product
      • productElement

        public java.lang.Object productElement​(int x$1)
        Specified by:
        productElement in interface scala.Product
      • productIterator

        public scala.collection.Iterator<java.lang.Object> productIterator()
        Specified by:
        productIterator in interface scala.Product
      • canEqual

        public boolean canEqual​(java.lang.Object x$1)
        Specified by:
        canEqual in interface scala.Equals
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object x$1)
        Specified by:
        equals in interface scala.Equals
        Overrides:
        equals in class java.lang.Object