|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.orekit.utils.GenericInterval<T> org.orekit.utils.ComparableInterval<AbsoluteDate> org.orekit.utils.AbsoluteDateInterval
public final class AbsoluteDateInterval
This class implements an interval based on the AbsoluteDate class,
using the ComparableInterval class.
This implementation enforces that AbsoluteDate.PAST_INFINITE
and
AbsoluteDate.FUTURE_INFINITE
cannot be closed boundaries.
final AbsoluteDate lowEnd = new AbsoluteDate();
final AbsoluteDate upEnd = new AbsoluteDate(lowEnd, 4578.14);
final IntervalEndpointType lowInt = IntervalEndpointType.CLOSED;
final IntervalEndpointType upInt = IntervalEndpointType.OPEN;
final AbsoluteDateInterval dateInterval = new AbsoluteDateInterval(lowInt, lowEnd, upEnd, upInt);
Constructor Summary | |
---|---|
AbsoluteDateInterval(IntervalEndpointType lowerEndpointIn,
AbsoluteDate lowerDataIn,
AbsoluteDate upperDataIn,
IntervalEndpointType upperEndpointIn)
Constructor for an AbsoluteDate interval. |
Method Summary | |
---|---|
int |
compareDurationTo(AbsoluteDateInterval interval)
Checks if the duration of the interval is longer, shorter or equal to the duration of another interval. It returns a positive integer if the duration is longer, a negative integer if the duration is shorter and zero if the durations of the two intervals are identical. The method checks also the lower and upper end points of the intervals, considering that an interval with an open end point is shorter than an interval with the same duration and a closed end point. |
double |
durationFrom(AbsoluteDateInterval interval)
Computes the duration in seconds between the two intervals. The duration between two intervals is the duration between the end of the earlier interval and the beginning of the later. If the intervals overlap, this duration is 0. The sign of the result is positive if the given interval comes earlier. |
double |
getDuration()
Computes the interval duration (its length) in seconds. The duration is the number of seconds physically elapsed between the lower and the upper endpoint, as computed by AbsoluteDate.durationFrom() .This means the duration is measured in a linear time scale (TAI time scale). |
AbsoluteDateInterval |
getIntersectionWith(AbsoluteDateInterval interval)
Intersects the interval with another interval if possible (i.e. |
AbsoluteDateInterval |
mergeTo(AbsoluteDateInterval interval)
Merges the interval with another interval if possible (i.e. |
Methods inherited from class org.orekit.utils.ComparableInterval |
---|
compareLowerEndTo, compareTo, compareUpperEndTo, contains, equals, hashCode, includes, isConnectedTo, overlaps |
Methods inherited from class org.orekit.utils.GenericInterval |
---|
getLowerData, getLowerEndpoint, getUpperData, getUpperEndpoint, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbsoluteDateInterval(IntervalEndpointType lowerEndpointIn, AbsoluteDate lowerDataIn, AbsoluteDate upperDataIn, IntervalEndpointType upperEndpointIn)
lowerDataIn
- lower end AbsoluteDateupperDataIn
- upper end AbsoluteDatelowerEndpointIn
- lower end boundary typeupperEndpointIn
- upper end boundary type
MathIllegalArgumentException
- when the interval is invalid (unchecked exception).GenericInterval
and ComparableInterval
checks, the infinite
date boundaries also have to be opened.ComparableInterval
,
GenericInterval
,
AbsoluteDate
Method Detail |
---|
public double getDuration()
AbsoluteDate.durationFrom()
.
AbsoluteDate.durationFrom(AbsoluteDate)
public double durationFrom(AbsoluteDateInterval interval)
interval
- the given interval
AbsoluteDate.durationFrom(AbsoluteDate)
public int compareDurationTo(AbsoluteDateInterval interval)
interval
- other interval
public AbsoluteDateInterval mergeTo(AbsoluteDateInterval interval)
AbsoluteDateInterval
.
interval
- the interval to be merged
public AbsoluteDateInterval getIntersectionWith(AbsoluteDateInterval interval)
AbsoluteDateInterval
.
interval
- the interval to be intersected
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |