module
VirtualTime::RangeHelper
Defined in:
virtualtime.crClass Method Summary
-
.intersect?(a : Range(Int32, Int32), b : Range(Int32, Int32)) : Bool
Returns whether the two ranges have at least one value in common.
-
.last(range : Range(Int32, Int32)) : Int32 | Nil
Returns the last value included in
range, ornilif it contains no values. -
.restart(value : Steppable::StepIterator(Int32, Int32, Int32))
Returns
valueready to be iterated from its first element. -
.restart(value)
Returns
valueready to be iterated from its first element.
Class Method Detail
Returns whether the two ranges have at least one value in common.
This is the O(1) counterpart of intersecting them by iteration, which matters because VirtualTime ranges can be enormous (e.g. nanoseconds).
Returns the last value included in range, or nil if it contains no values.
Returns value ready to be iterated from its first element.
Steppable::StepIterators are stateful and are consumed by iteration,
so they must be copied before every traversal; everything else is
returned as-is.
Returns value ready to be iterated from its first element.
Steppable::StepIterators are stateful and are consumed by iteration,
so they must be copied before every traversal; everything else is
returned as-is.