TimeWindow

abstract class TimeWindow

An interval on the time-line; not a single instantaneous point.

There is no such thing as exact time in networked systems due to the underlying physics involved and other issues such as network latency. The best that can be approximated is "fuzzy time" or an instant of time which has margin of tolerance around it. This is what TimeWindow represents. Time windows can be open-ended (i.e. specify only one of fromTime and untilTime) or they can be fully bounded.

WireTransaction has an optional time-window property, which if specified, restricts the validity of the transaction to that time-interval as the Consensus Service will not sign it if it's received outside of this window.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val fromTime: Instant?

Returns the inclusive lower-bound of this TimeWindow's interval, with null implying infinity.

Link copied to clipboard

Returns the duration between fromTime and untilTime if both are non-null. Otherwise returns null.

Link copied to clipboard
abstract val midpoint: Instant?

Returns the midpoint of fromTime and untilTime if both are non-null, calculated as fromTime + (untilTime - fromTime) / 2, otherwise returns null.

Link copied to clipboard
abstract val untilTime: Instant?

Returns the exclusive upper-bound of this TimeWindow's interval, with null implying infinity.

Functions

Link copied to clipboard
abstract operator fun contains(instant: Instant): Boolean

Returns true iff the given instant is within the time interval of this TimeWindow.