public class LogicalClock extends Object implements Clock<LogicalTimestamp>
| Constructor and Description |
|---|
LogicalClock() |
LogicalClock(LogicalTimestamp currentTimestamp) |
| Modifier and Type | Method and Description |
|---|---|
LogicalTimestamp |
getTime()
Returns the current time of the clock.
|
LogicalTimestamp |
increment()
Increments the clock and returns the new timestamp.
|
LogicalTimestamp |
incrementAndUpdate(LogicalTimestamp timestamp)
Increments the clock and updates it using the given timestamp.
|
String |
toString() |
LogicalTimestamp |
update(LogicalTimestamp timestamp)
Updates the clock using the given timestamp.
|
public LogicalClock()
public LogicalClock(LogicalTimestamp currentTimestamp)
public LogicalTimestamp getTime()
ClockgetTime in interface Clock<LogicalTimestamp>public LogicalTimestamp increment()
public LogicalTimestamp update(LogicalTimestamp timestamp)
timestamp - the timestamp with which to update the clockpublic LogicalTimestamp incrementAndUpdate(LogicalTimestamp timestamp)
timestamp - the timestamp with which to update the clockCopyright © 2013–2019. All rights reserved.