public final class GPDateUtils extends Object
Modifier and Type | Field and Description |
---|---|
static double |
DATE_COMPARISON_PRECISION
Precision for dates comparison (0.5 nanoseconds).
|
static int |
DAY_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of days for getting nanosecond precision.
|
static String |
DECIMAL_SYMBOL
Symbol to be used as decimal separator for dates.
|
static int |
HOUR_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of hours for getting nanosecond precision.
|
static double |
HOURS_2_SECS
Hours to seconds multiplier.
|
static int |
MICRO_SEC_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of microseconds for getting nanosecond precision.
|
static double |
MICROSECS_2_SECS
Microseconds to seconds multiplier.
|
static int |
MILI_SEC_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of milliseconds for getting nanosecond precision.
|
static double |
MILISECS_2_SECS
Milliseconds to seconds multiplier.
|
static int |
MIN_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of minutes for getting nanosecond precision.
|
static double |
MINS_2_SECS
Minutes to seconds multiplier.
|
static String |
MINUS_SYMBOL
Symbol "minus" for dates.
|
static int |
NANO_SEC_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of nanoseconds for getting nanosecond precision.
|
static double |
NANOSECS_2_SECS
Nanoseconds to seconds multiplier.
|
static int |
SEC_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of seconds for getting nanosecond precision.
|
static String |
SUFIX1950
Suffix to indicate that the date's origin is: 01/01/1950 00h00m00s.
|
static String |
SUFIX2000
Suffix to indicate that the date's origin is: 01/01/2000 00h00m00s.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkDate(fr.cnes.sirius.patrius.time.AbsoluteDate date)
Method to check if an AbsoluteDate contains NaN value for the seconds in day.
|
static fr.cnes.sirius.patrius.time.AbsoluteDate |
computeDate(fr.cnes.sirius.patrius.time.AbsoluteDate dateOrigin,
int jjFromOrigin,
double secOfDay,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
Compute an AbsoluteDate from an origin with an elapsed time given by a number of integer days and the
seconds of day in a given time scale.
|
static String |
getFormatedValue(double value,
Integer maxIntDigits,
Integer minIntDigits,
Integer maxFracDigits,
Integer minFracDigits)
Generation of a decimal formatter to represents decimal numbers with a minimum and a maximum number of
digits in the integer part and in the fractional part.
|
static String |
getFormatedValue(double value,
int maxFracDigits,
int minFracDigits)
Generation of a decimal formatter to represents decimal numbers with a minimum and a maximum number of
digits.
|
static int[] |
getSubSeconds(double seconds)
Get the integer number of seconds, milliseconds, microseconds, and nanoseconds of a given real number
of seconds.
|
static void |
isWithinLimits(fr.cnes.sirius.patrius.time.AbsoluteDate date)
Checks if a date is within the limits defined to allow calendar representation.
|
static void |
isWithinLimits(fr.cnes.sirius.patrius.time.AbsoluteDate dateOrigin,
double secsFromOrigin,
fr.cnes.sirius.patrius.time.TimeScale timeScale)
Checks if a date is within the limits defined to allow calendar representation.
|
public static final double DATE_COMPARISON_PRECISION
public static final double NANOSECS_2_SECS
public static final double MICROSECS_2_SECS
public static final double MILISECS_2_SECS
public static final double MINS_2_SECS
public static final double HOURS_2_SECS
public static final int NANO_SEC_MAX_FRAC_DIGITS
public static final int MICRO_SEC_MAX_FRAC_DIGITS
public static final int MILI_SEC_MAX_FRAC_DIGITS
public static final int SEC_MAX_FRAC_DIGITS
public static final int MIN_MAX_FRAC_DIGITS
public static final int HOUR_MAX_FRAC_DIGITS
public static final int DAY_MAX_FRAC_DIGITS
public static final String SUFIX2000
public static final String SUFIX1950
public static final String MINUS_SYMBOL
public static final String DECIMAL_SYMBOL
public static fr.cnes.sirius.patrius.time.AbsoluteDate computeDate(fr.cnes.sirius.patrius.time.AbsoluteDate dateOrigin, int jjFromOrigin, double secOfDay, fr.cnes.sirius.patrius.time.TimeScale timeScale) throws GPDateException, fr.cnes.genius.exception.GArithmeticException
dateOrigin
- origin of datejjFromOrigin
- integer number of julian days from the originsecOfDay
- real number of seconds of daytimeScale
- time scaleGPDateException
- if the date is out of range for calendar representationfr.cnes.genius.exception.GArithmeticException
- if dateOrigin contains NaN seconds or secOfDay is NaN.public static void isWithinLimits(fr.cnes.sirius.patrius.time.AbsoluteDate date) throws GPDateException
s_minDate
to s_maxDate
.date
- to be tested against the date validity interval.GPDateException
- if the date if out of range.public static void isWithinLimits(fr.cnes.sirius.patrius.time.AbsoluteDate dateOrigin, double secsFromOrigin, fr.cnes.sirius.patrius.time.TimeScale timeScale) throws GPDateException, fr.cnes.genius.exception.GArithmeticException
s_minDate
to s_maxDate
. The date is defined by an origin and an offset in seconds in a given time scale.dateOrigin
- origin date of the date to be tested against the date validity interval.secsFromOrigin
- offset from dateOrigin to the date to be tested.timeScale
- in which the secsFromOrigin offset is givenGPDateException
- if the date if out of range.fr.cnes.genius.exception.GArithmeticException
- if dateOrigin contains NaN seconds.public static int[] getSubSeconds(double seconds)
seconds
- the real number of secondspublic static String getFormatedValue(double value, int maxFracDigits, int minFracDigits)
value
- the value to format.maxFracDigits
- maximum number of fractional digitsminFracDigits
- minimum number of fractional digitspublic static String getFormatedValue(double value, Integer maxIntDigits, Integer minIntDigits, Integer maxFracDigits, Integer minFracDigits)
value
- the value to format.maxIntDigits
- maximum number of digits for the integer partminIntDigits
- minimum number of digits for the integer partmaxFracDigits
- maximum number of digits for the fractional partminFracDigits
- minimum number of digits for the fractional partpublic static void checkDate(fr.cnes.sirius.patrius.time.AbsoluteDate date) throws fr.cnes.genius.exception.GArithmeticException
date
- to be checked.fr.cnes.genius.exception.GArithmeticException
- if the date contains a NaN value in the double for the seconds in day (offset attribut)Copyright © 2023. All rights reserved.