Package org.orekit.time
Interface TimeInterval
public interface TimeInterval
Interface representing a closed time interval i.e. [a, b], possibly of infinite length.
- Since:
- 13.1
- Author:
- Romain Serra
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancontains(TimeInterval interval) Method returning true if and only if input (also a closed time interval) contains the instance.default booleancontains(TimeStamped timeStamped) Method returning true if and only if the dated input is contained within the closed interval.default doubleduration()Computes the interval length in seconds.Getter for the right end of the interval.Getter for the left end of the interval.default booleanintersects(TimeInterval interval) Method returning true if and only if input (also a closed time interval) intersects the instance.static TimeIntervalof(AbsoluteDate date, double duration) Create instance from two dates in arbitrary order.static TimeIntervalof(AbsoluteDate date, AbsoluteDate otherDate) Create instance from two dates in arbitrary order.
-
Method Details
-
getStartDate
AbsoluteDate getStartDate()Getter for the left end of the interval.- Returns:
- left end
-
getEndDate
AbsoluteDate getEndDate()Getter for the right end of the interval.- Returns:
- right end
-
duration
default double duration()Computes the interval length in seconds.- Returns:
- duration
-
contains
Method returning true if and only if the dated input is contained within the closed interval.- Parameters:
timeStamped- time stamped object- Returns:
- boolean on inclusion
-
contains
Method returning true if and only if input (also a closed time interval) contains the instance.- Parameters:
interval- time interval- Returns:
- boolean on inclusion
-
intersects
Method returning true if and only if input (also a closed time interval) intersects the instance.- Parameters:
interval- time interval- Returns:
- boolean on intersection
-
of
Create instance from two dates in arbitrary order.- Parameters:
date- dateotherDate- other date- Returns:
- time interval
-
of
Create instance from two dates in arbitrary order.- Parameters:
date- start (or end) dateduration- duration, in seconds (if positive, time interval is from date to date + duration, if negative, the time interval will be from date - duration to date)- Returns:
- time interval
- Since:
- 14.0
-