public class DeltaRGA extends DeltaBasedCRDT
| Modifier and Type | Field and Description |
|---|---|
static pt.unl.fct.di.novasys.network.ISerializer<DeltaRGA> |
serializer
A serializer that serializes the CRDT into (and from) a ByteBuf.
|
static CRDTsTypes |
TYPE |
state| Constructor and Description |
|---|
DeltaRGA(ReplicaID replicaID)
Creates a delta RGA with a given replicaID.
|
DeltaRGA(ReplicaID replicaID,
List<SerializableType> initialValues)
Creates a delta RGA with a given replicaID and a list of initial values.
|
DeltaRGA(VVState state)
Creates a delta RGA with a given replica state.
|
DeltaRGA(VVState state,
List<SerializableType> initialValues)
Creates a delta RGA with a given replica state and a list of initial values.
|
| Modifier and Type | Method and Description |
|---|---|
GenericCRDT |
copy()
Creates a copy of the CRDT.
|
DeltaRGA |
generateDelta(VersionVector vv)
Calculates a delta from a given version for the current state
|
Iterator<SerializableType> |
get()
An iterator with all the elements inside the array
|
SerializableType |
getAt(int index)
Obtains the element at position index
|
DeltaRGA |
insertAt(int index,
SerializableType element)
Insert an element into position index
|
DeltaRGA |
mergeDelta(DeltaBasedCRDT crdt)
Applies a delta to the current state.
|
DeltaRGA |
removeAt(int index)
Removes an element at position index
|
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<DeltaRGA> serializer
public DeltaRGA(ReplicaID replicaID)
replicaID - the replica identifierpublic DeltaRGA(VVState state)
state - replica current statepublic DeltaRGA(ReplicaID replicaID, List<SerializableType> initialValues)
replicaID - the replica identifierinitialValues - the initial values of the CRDTpublic DeltaRGA(VVState state, List<SerializableType> initialValues)
state - replica current stateinitialValues - the initial values of the CRDTpublic DeltaRGA insertAt(int index, SerializableType element)
index - position to insert the elementelement - element to be insertedIndexOutOfBoundsException - if the index is out of the array boundspublic DeltaRGA removeAt(int index)
index - position to insert the elementIndexOutOfBoundsException - if the index is out of the array boundspublic Iterator<SerializableType> get()
public SerializableType getAt(int index)
index - the index of the elementIndexOutOfBoundsException - if the index is out of the array boundspublic DeltaRGA generateDelta(VersionVector vv)
DeltaCRDTgenerateDelta in interface DeltaCRDTgenerateDelta in class DeltaBasedCRDTvv - a version version to calculate the delta frompublic DeltaRGA 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.