public class Timestamp extends Object implements Comparable<Timestamp>
| Modifier and Type | Field and Description |
|---|---|
static pt.unl.fct.di.novasys.network.ISerializer<Timestamp> |
serializer
A serializer to serialize a given timestamp.
|
| Constructor and Description |
|---|
Timestamp(ReplicaID replicaID)
Creates a new timestamp with the counter as zero.
|
Timestamp(ReplicaID replicaID,
int counter)
Creates a new timestamp.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Timestamp o)
Compares a timestamp passed as argument with this timestamp.
|
Timestamp |
copy()
Creates a copy of this timestamp.
|
boolean |
equals(Object o) |
int |
getCount()
Get the current counter value.
|
ReplicaID |
getReplicaID()
Get the replica identifier
|
int |
hashCode() |
boolean |
isBigger(Timestamp ts)
Checks if a given timestamp is bigger than the current counter
|
boolean |
isBiggerOrEqual(Timestamp ts)
Checks if a given timestamp is bigger or equal than the current counter
|
boolean |
isEqual(Timestamp ts)
Checks if a given timestamp is equal than the current counter
|
boolean |
isSmaller(Timestamp ts)
Checks if a given timestamp is smaller than the current counter
|
boolean |
isSmallerOrEqual(Timestamp ts)
Checks if a given timestamp is smaller or equal than the current counter
|
static Timestamp |
max(Timestamp ts1,
Timestamp ts2)
Compares two timestamps.
|
String |
toString() |
public static pt.unl.fct.di.novasys.network.ISerializer<Timestamp> serializer
public Timestamp(ReplicaID replicaID, int counter)
replicaID - replica identifiercounter - the counter (must be bigger than zero).public Timestamp(ReplicaID replicaID)
replicaID - replica identifierpublic int getCount()
public ReplicaID getReplicaID()
public boolean isSmaller(Timestamp ts)
ts - timestamp to comparepublic boolean isSmallerOrEqual(Timestamp ts)
ts - timestamp to comparepublic boolean isBigger(Timestamp ts)
ts - timestamp to comparepublic boolean isBiggerOrEqual(Timestamp ts)
ts - timestamp to comparepublic boolean isEqual(Timestamp ts)
ts - timestamp to comparepublic Timestamp copy()
public int compareTo(Timestamp o)
compareTo in interface Comparable<Timestamp>Copyright © 2024. All rights reserved.