TimeInterval class
Represents a closed time interval [lowerBound, upperBound] used in MTL formulas.
The bounds are inclusive and represented using Duration.
Both bounds must be non-negative, and upperBound must be greater than
or equal to lowerBound.
Use factory constructors like TimeInterval.exactly, TimeInterval.upTo, TimeInterval.atLeast, or TimeInterval.always for common interval types.
- Annotations
Constructors
- TimeInterval(Duration lowerBound, Duration upperBound)
-
Creates a closed time interval
[lowerBound, upperBound]. - TimeInterval.always()
-
Creates an interval representing all non-negative time:
[0, infinity). Equivalent toTimeInterval.atLeast(Duration.zero).factory - TimeInterval.atLeast(Duration d)
-
Creates an interval from duration
donwards:[d, infinity).factory - TimeInterval.exactly(Duration d)
-
Creates an interval representing exactly duration
d:[d, d].factory - TimeInterval.upTo(Duration d)
-
Creates an interval from zero up to duration
d:[0, d].factory
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- isUnbounded → bool
-
Returns
truewhen this interval has no finite upper bound.no setter - lowerBound → Duration
-
The inclusive lower bound of the time interval.
Must be non-negative.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- upperBound → Duration
-
The inclusive upper bound of the time interval.
Must be greater than or equal to lowerBound.
Note: "Infinity" is currently represented by a very large duration.
final
Methods
-
contains(
Duration duration) → bool -
Checks if the given
durationfalls within this time interval (inclusive). -
exceedsUpperBound(
Duration duration) → bool -
Returns
truewhendurationis strictly greater than the finite upper bound. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
Returns a string representation, e.g.,
[100ms, 500ms]or[1000ms, inf).override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override