public class DeltaCausalCounter extends DeltaCausalBasedCRDT
| Modifier and Type | Field and Description |
|---|---|
static pt.unl.fct.di.novasys.network.ISerializer<DeltaCausalCounter> |
serializer
A serializer that serializes the CRDT into (and from) a ByteBuf.
|
state| Constructor and Description |
|---|
DeltaCausalCounter(CausalContext state) |
DeltaCausalCounter(CausalContext state,
Integer initialValue) |
DeltaCausalCounter(ReplicaID replicaID) |
DeltaCausalCounter(ReplicaID replicaID,
Integer initialValue) |
| Modifier and Type | Method and Description |
|---|---|
GenericCRDT |
copy()
Creates a copy of the CRDT.
|
DeltaCausalCounter |
decrement(int amount) |
DeltaCausalCounter |
generateDelta(VersionVector vv)
Calculates a delta from a given version for the current state
|
CausalContext |
getCausalContext() |
DeltaCausalCounter |
increment(int amount) |
DeltaCausalCounter |
mergeDelta(DeltaBasedCRDT delta)
Applies a delta to the current state.
|
DeltaCausalCounter |
reset() |
void |
serialize(io.netty.buffer.ByteBuf in)
Serializes the CRDT into a ByteBuf
|
int |
value() |
getReplicaID, getReplicaStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeserializeDataType, getTypepublic static pt.unl.fct.di.novasys.network.ISerializer<DeltaCausalCounter> serializer
public DeltaCausalCounter(CausalContext state)
public DeltaCausalCounter(ReplicaID replicaID)
public DeltaCausalCounter(CausalContext state, Integer initialValue)
public int value()
public DeltaCausalCounter increment(int amount)
public DeltaCausalCounter decrement(int amount)
public DeltaCausalCounter reset()
public GenericCRDT copy()
GenericCRDTpublic void serialize(io.netty.buffer.ByteBuf in)
throws IOException
GenericCRDTin - ByteBuf to serialize the CRDT toIOException - if an error occurs while serializingpublic CausalContext getCausalContext()
public DeltaCausalCounter generateDelta(VersionVector vv)
DeltaCRDTgenerateDelta in interface DeltaCRDTgenerateDelta in class DeltaCausalBasedCRDTvv - a version version to calculate the delta frompublic DeltaCausalCounter mergeDelta(DeltaBasedCRDT delta)
DeltaCRDTmergeDelta in interface DeltaCRDTmergeDelta in class DeltaCausalBasedCRDTdelta - a crdt representing the deltaCopyright © 2024. All rights reserved.