@Beta public class VectorClock<T extends Identifier> extends java.lang.Object implements Clock<VectorTimestamp<T>>
| Constructor and Description |
|---|
VectorClock(T localIdentifier) |
VectorClock(VectorTimestamp<T> localTimestamp) |
VectorClock(VectorTimestamp<T> localTimestamp,
java.util.Collection<VectorTimestamp<T>> vector) |
| Modifier and Type | Method and Description |
|---|---|
LogicalTimestamp |
getLocalTimestamp()
Returns the local logical timestamp.
|
VectorTimestamp<T> |
getTime()
Returns the current time of the clock.
|
LogicalTimestamp |
getTimestamp(T identifier)
Returns the logical timestamp for the given identifier.
|
java.util.Collection<VectorTimestamp<T>> |
getTimestamps()
Returns a collection of identifier-timestamp pairs.
|
java.lang.String |
toString() |
void |
update(VectorClock<T> clock)
Updates the vector clock.
|
void |
update(VectorTimestamp<T> timestamp)
Updates the given timestamp.
|
public VectorClock(T localIdentifier)
public VectorClock(VectorTimestamp<T> localTimestamp)
public VectorClock(VectorTimestamp<T> localTimestamp, java.util.Collection<VectorTimestamp<T>> vector)
public VectorTimestamp<T> getTime()
ClockgetTime in interface Clock<VectorTimestamp<T extends Identifier>>public LogicalTimestamp getLocalTimestamp()
public LogicalTimestamp getTimestamp(T identifier)
identifier - the identifier for which to return the timestamppublic java.util.Collection<VectorTimestamp<T>> getTimestamps()
public void update(VectorTimestamp<T> timestamp)
timestamp - the timestamp to updatepublic void update(VectorClock<T> clock)
clock - the vector clock with which to update this clockpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2013-2018. All Rights Reserved.