Package org.yamcs.studio.data.sim
Class TimeInterval
java.lang.Object
org.yamcs.studio.data.sim.TimeInterval
A period of time that spans two instances (included) at the nanosecond precision.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TimeInterval
Returns a time interval that lasts this duration and starts from the given instant.static TimeInterval
Returns a time interval that lasts this duration and is centered around the given instant reference.static TimeInterval
Returns a time interval that lasts this duration and ends at the given instant.static TimeInterval
Returns the interval between the given timestamps.boolean
True if the given time stamp is inside the interval.boolean
getEnd()
Final value of the interval.getStart()
Initial value of the interval.int
hashCode()
Returns a new interval shifted backward in time by the given duration.toString()
-
Method Details
-
contains
True if the given time stamp is inside the interval.- Parameters:
instant
- a time stamp- Returns:
- true if inside the interval
-
between
Returns the interval between the given timestamps.- Parameters:
start
- the beginning of the intervalend
- the end of the interval- Returns:
- a new interval
-
minus
Returns a new interval shifted backward in time by the given duration.- Parameters:
duration
- a time duration- Returns:
- the new shifted interval
-
around
Returns a time interval that lasts this duration and is centered around the given instant reference.- Parameters:
duration
- the durationreference
- a instant- Returns:
- a new time interval
-
after
Returns a time interval that lasts this duration and starts from the given instant.- Parameters:
duration
- the durationreference
- a instant- Returns:
- a new time interval
-
before
Returns a time interval that lasts this duration and ends at the given instant.- Parameters:
duration
- the durationreference
- a instant- Returns:
- a new time interval
-
getStart
Initial value of the interval.- Returns:
- the initial instant
-
getEnd
Final value of the interval.- Returns:
- the final instant
-
toString
-
equals
-
hashCode
public int hashCode()
-