Add comparison methods in AbsoluteDate to improve readability
During the discussion here, the community has decided that some new comparison methods in the class AbsoluteDate and FieldAbsoluteDate would help users of Orekit to write more readable code.
List of new methods to create in class AbsoluteDate and FieldAbsoluteDate (with TimeStamped replaced by FieldTimeStamped for FieldAbsoluteDate):
-
isEqualTo(TimeStamped t)
: true if instance equalst.getDate()
-
isCloseTo(TimeStamped t, double tolerance)
: true ift.getDate()
is separated from instance by less than tolerance seconds. -
isBefore(TimeStamped t)
: true if instance is strictly beforet.getDate()
-
isAfter(TimeStamped t)
: true if instance is strictly aftert.getDate()
-
isBeforeOrEqualTo(TimeStamped t)
: true if instance is simultaneous or beforet.getDate()
-
isAfterOrEqualTo(TimeStamped t)
: true if instance is simultaneous or aftert.getDate()
-
isBetween(TimeStamped t1, TimeStamped t2)
: true if instance is strictly betweent1.getDate()
andt2.getDate()
.t1
andt2
can be in any chronological order, but if they represent the same instant this will always return false. -
isBetweenOrEqualTo(TimeStamped t1, TimeStamped t2)
: true if instance is strictly betweent1.getDate()
andt2.getDate()
.t1
andt2
can be in any chronological order
Edited by Yannick Jeandroz