Package com.usatiuk.kleppmanntree
Interface Clock<TimestampT extends Comparable<TimestampT>>
public interface Clock<TimestampT extends Comparable<TimestampT>>
Clock interface
-
Method Summary
Modifier and TypeMethodDescriptionIncrement and get the current timestamp.Get the current timestamp without incrementing it.updateTimestamp
(TimestampT receivedTimestamp) Update the timestamp with an externally received timestamp.
-
Method Details
-
getTimestamp
TimestampT getTimestamp()Increment and get the current timestamp.- Returns:
- the incremented timestamp
-
peekTimestamp
TimestampT peekTimestamp()Get the current timestamp without incrementing it.- Returns:
- the current timestamp
-
updateTimestamp
Update the timestamp with an externally received timestamp. Will set the currently stored timestamp tomax(receivedTimestamp, currentTimestamp) + 1
- Parameters:
receivedTimestamp
- the received timestamp- Returns:
- the previous timestamp
-