public class DeltaLWWSet extends DeltaBasedCRDT
| Modifier and Type | Field and Description |
|---|---|
static pt.unl.fct.di.novasys.network.ISerializer<DeltaLWWSet> |
serializer
A serializer that serializes the CRDT into (and from) a ByteBuf.
|
static CRDTsTypes |
TYPE |
state| Constructor and Description |
|---|
DeltaLWWSet(ReplicaID replicaID) |
DeltaLWWSet(ReplicaID replicaID,
Set<SerializableType> initialValues) |
DeltaLWWSet(VVState state) |
DeltaLWWSet(VVState state,
Set<SerializableType> initialValues) |
| Modifier and Type | Method and Description |
|---|---|
DeltaLWWSet |
add(SerializableType element)
Adds an element to the set.
|
GenericCRDT |
copy()
Creates a copy of the CRDT.
|
DeltaLWWSet |
generateDelta(VersionVector vv)
Calculates a delta from a given version for the current state
|
Iterator<SerializableType> |
iterator()
Returns an iterator of the elements in the set.
|
boolean |
lookup(SerializableType element)
Searches for the element passed as argument.
|
DeltaLWWSet |
mergeDelta(DeltaBasedCRDT crdt)
Applies a delta to the current state.
|
DeltaLWWSet |
remove(SerializableType element)
Removes an element of the set.
|
void |
serialize(io.netty.buffer.ByteBuf in)
Serializes the CRDT into a ByteBuf
|
getReplicaID, getReplicaStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeserializeDataType, getTypepublic static final CRDTsTypes TYPE
public static pt.unl.fct.di.novasys.network.ISerializer<DeltaLWWSet> serializer
public DeltaLWWSet(ReplicaID replicaID)
public DeltaLWWSet(VVState state)
public DeltaLWWSet(ReplicaID replicaID, Set<SerializableType> initialValues)
public DeltaLWWSet(VVState state, Set<SerializableType> initialValues)
public DeltaLWWSet add(SerializableType element)
element - the element to insertpublic DeltaLWWSet remove(SerializableType element)
element - the element to insertpublic boolean lookup(SerializableType element)
element - element to searchpublic Iterator<SerializableType> iterator()
public DeltaLWWSet generateDelta(VersionVector vv)
DeltaCRDTgenerateDelta in interface DeltaCRDTgenerateDelta in class DeltaBasedCRDTvv - a version version to calculate the delta frompublic DeltaLWWSet mergeDelta(DeltaBasedCRDT crdt) throws CRDTNotValidException
DeltaCRDTmergeDelta in interface DeltaCRDTmergeDelta in class DeltaBasedCRDTcrdt - a crdt representing the deltaCRDTNotValidException - if the crdt passed as argument is invalidpublic GenericCRDT copy()
GenericCRDTpublic void serialize(io.netty.buffer.ByteBuf in)
throws IOException
GenericCRDTin - ByteBuf to serialize the CRDT toIOException - if an error occurs while serializingCopyright © 2024. All rights reserved.