fr.cnes.genopus.time
Class GPDateUtils

java.lang.Object
  extended by fr.cnes.genopus.time.GPDateUtils

public final class GPDateUtils
extends Object

Class defining some general methods for dates manipulation.

Author:
aadt

Field Summary
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.
 
Method Summary
static org.orekit.time.AbsoluteDate computeDate(org.orekit.time.AbsoluteDate dateOrigin, int jjFromOrigin, double secOfDay, org.orekit.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(org.orekit.time.AbsoluteDate date)
          Checks if a date is within the limits defined to allow calendar representation.
static void isWithinLimits(org.orekit.time.AbsoluteDate dateOrigin, double secsFromOrigin, org.orekit.time.TimeScale timeScale)
          Checks if a date is within the limits defined to allow calendar representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_COMPARISON_PRECISION

public static final double DATE_COMPARISON_PRECISION
Precision for dates comparison (0.5 nanoseconds).

See Also:
Constant Field Values

NANOSECS_2_SECS

public static final double NANOSECS_2_SECS
Nanoseconds to seconds multiplier.

See Also:
Constant Field Values

MICROSECS_2_SECS

public static final double MICROSECS_2_SECS
Microseconds to seconds multiplier.

See Also:
Constant Field Values

MILISECS_2_SECS

public static final double MILISECS_2_SECS
Milliseconds to seconds multiplier.

See Also:
Constant Field Values

MINS_2_SECS

public static final double MINS_2_SECS
Minutes to seconds multiplier.

See Also:
Constant Field Values

HOURS_2_SECS

public static final double HOURS_2_SECS
Hours to seconds multiplier.

See Also:
Constant Field Values

NANO_SEC_MAX_FRAC_DIGITS

public static final int NANO_SEC_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of nanoseconds for getting nanosecond precision.

See Also:
Constant Field Values

MICRO_SEC_MAX_FRAC_DIGITS

public static final int MICRO_SEC_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of microseconds for getting nanosecond precision.

See Also:
Constant Field Values

MILI_SEC_MAX_FRAC_DIGITS

public static final int MILI_SEC_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of milliseconds for getting nanosecond precision.

See Also:
Constant Field Values

SEC_MAX_FRAC_DIGITS

public static final int SEC_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of seconds for getting nanosecond precision.

See Also:
Constant Field Values

MIN_MAX_FRAC_DIGITS

public static final int MIN_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of minutes for getting nanosecond precision.

See Also:
Constant Field Values

HOUR_MAX_FRAC_DIGITS

public static final int HOUR_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of hours for getting nanosecond precision.

See Also:
Constant Field Values

DAY_MAX_FRAC_DIGITS

public static final int DAY_MAX_FRAC_DIGITS
Number of fractional digits to keep on a number of days for getting nanosecond precision.

See Also:
Constant Field Values

SUFIX2000

public static final String SUFIX2000
Suffix to indicate that the date's origin is: 01/01/2000 00h00m00s.

See Also:
Constant Field Values

SUFIX1950

public static final String SUFIX1950
Suffix to indicate that the date's origin is: 01/01/1950 00h00m00s.

See Also:
Constant Field Values

MINUS_SYMBOL

public static final String MINUS_SYMBOL
Symbol "minus" for dates.

See Also:
Constant Field Values

DECIMAL_SYMBOL

public static final String DECIMAL_SYMBOL
Symbol to be used as decimal separator for dates.

See Also:
Constant Field Values
Method Detail

computeDate

public static org.orekit.time.AbsoluteDate computeDate(org.orekit.time.AbsoluteDate dateOrigin,
                                                       int jjFromOrigin,
                                                       double secOfDay,
                                                       org.orekit.time.TimeScale timeScale)
                                                throws GPDateException
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.

Parameters:
dateOrigin - origin of date
jjFromOrigin - integer number of julian days from the origin
secOfDay - real number of seconds of day
timeScale - time scale
Returns:
the AbsoluteDate computed
Throws:
GPDateException - if the date is out of range for calendar representation

isWithinLimits

public static void isWithinLimits(org.orekit.time.AbsoluteDate date)
                           throws GPDateException
Checks if a date is within the limits defined to allow calendar representation. From s_minDate to s_maxDate.

Parameters:
date - to be tested against the date validity interval.
Throws:
GPDateException - if the date if out of range.

isWithinLimits

public static void isWithinLimits(org.orekit.time.AbsoluteDate dateOrigin,
                                  double secsFromOrigin,
                                  org.orekit.time.TimeScale timeScale)
                           throws GPDateException
Checks if a date is within the limits defined to allow calendar representation. From s_minDate to s_maxDate. The date is defined by an origin and an offset in seconds in a given time scale.

Parameters:
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 given
Throws:
GPDateException - if the date if out of range.

getSubSeconds

public static int[] getSubSeconds(double seconds)
Get the integer number of seconds, milliseconds, microseconds, and nanoseconds of a given real number of seconds.

Parameters:
seconds - the real number of seconds
Returns:
the integer number of seconds, milliseconds, microseconds, and nanoseconds

getFormatedValue

public 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.

Parameters:
value - the value to format.
maxFracDigits - maximum number of fractional digits
minFracDigits - minimum number of fractional digits
Returns:
the decimal formatter

getFormatedValue

public 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.

Parameters:
value - the value to format.
maxIntDigits - maximum number of digits for the integer part
minIntDigits - minimum number of digits for the integer part
maxFracDigits - maximum number of digits for the fractional part
minFracDigits - minimum number of digits for the fractional part
Returns:
the decimal formatter


Copyright © 2017. All rights reserved.