HLC class Null safety

A hybrid logical clock implementation with string-based nodes.

Implemented types


HLC({required int timestamp, required int count, required String node})
Constructs an HLC from the given parameters.


count int
The clock's event count, which breaks ties in the case of identical clocks.
hashCode int
The hash code for this object. [...]
read-only, override
node String
This node's name (or ID), which breaks ties in the case of identical counts.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
timestamp int
The clock's timestamp.


compareTo(HLC other) int
Compares this object to another object. [...]
copy({int? timestamp, int? count, String? node}) HLC
Constructs a copy of this HLC with the given parameters.
increment() HLC
Produces the next, local clock.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
pack() String
Encodes this HLC into a string representation whose topological ordering is equivalent to that of the original HLC.
receive(HLC remote, {Duration? maximumDrift, int? now}) HLC
Synchronizes with a given remote clock. [...]
toString() String
A string representation of this object. [...]


operator ==(dynamic other) bool
The equality operator. [...]

Static Properties

delimiter String
The delimiter used for packing and unpacking this HLC in a string. [...]
read / write

Static Methods

now(String node) HLC
Constructs an initial HLC using the current wall clock.
unpack(String packed) HLC
Decodes an HLC previously packed with pack, else fails with a FormatException.