Package gaiasky.util.gaia.time
Class Secs
java.lang.Object
gaiasky.util.gaia.time.ConcreteDuration
gaiasky.util.gaia.time.Secs
- All Implemented Interfaces:
Duration
,Serializable
A finite number of seconds.
There are two implementations provided of the conversions methods one as
object interface, where an object of the current class has to be
instantiated. The oder implementation is provided as static class methods.
Performance tests of both implementations have come up with a performance
improvement of 20% of the static methods compared with the object methods.
- See Also:
-
Field Summary
Fields inherited from class gaiasky.util.gaia.time.ConcreteDuration
value
Fields inherited from interface gaiasky.util.gaia.time.Duration
DAYS_PER_JULIAN_YEAR, HOURS_PER_DAY, HOURS_PER_JULIAN_YEAR, HOURS_PER_REV, MINS_PER_DAY, MINS_PER_HOUR, MINS_PER_JULIAN_YEAR, MINS_PER_REV, NS_PER_DAY, NS_PER_DAY_L, NS_PER_HOUR, NS_PER_HOUR_L, NS_PER_JULIAN_YEAR, NS_PER_JULIAN_YEAR_L, NS_PER_MIN, NS_PER_MIN_L, NS_PER_REV, NS_PER_REV_L, NS_PER_SEC, REVS_PER_DAY, REVS_PER_JULIAN_YEAR, SECS_PER_DAY, SECS_PER_HOUR, SECS_PER_JULIAN_YEAR, SECS_PER_MIN, SECS_PER_REV
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a duration to this onedouble
asDays()
static double
asDays
(double secs) double
asHours()
static double
asHours
(double secs) double
static double
asJulianYears
(double secs) double
asMins()
static double
asMins
(double secs) long
static long
asNanoSecs
(double secs) double
asRevs()
static double
asRevs
(double secs) double
asSecs()
clone()
Set this duration to a new given oneSubtract a duration from this oneMethods inherited from class gaiasky.util.gaia.time.ConcreteDuration
getScale, isLongerThan, mult, negate, setScale
-
Constructor Details
-
Secs
public Secs()Default constructor -
Secs
public Secs(double secs) Construct object from an elapsed number of seconds.- Parameters:
secs
- elapsed time [seconds]
-
-
Method Details
-
set
Description copied from interface:Duration
Set this duration to a new given one -
asNanoSecs
public long asNanoSecs()- Specified by:
asNanoSecs
in interfaceDuration
- Returns:
- duration expressed in ns
- See Also:
-
asNanoSecs
public static long asNanoSecs(double secs) - Parameters:
secs
- Time in secs to process- Returns:
- Secs expressed in nanosec
-
asSecs
public double asSecs() -
asMins
public double asMins() -
asMins
public static double asMins(double secs) - Parameters:
secs
- Time in secs to convert- Returns:
- Secs expressed in mins
-
asHours
public double asHours() -
asHours
public static double asHours(double secs) - Parameters:
secs
- Time in secs to convert- Returns:
- Secs expressed in hours
-
asRevs
public double asRevs() -
asRevs
public static double asRevs(double secs) - Parameters:
secs
- Time in secs to convert- Returns:
- Secs expressed in days
-
asDays
public double asDays() -
asDays
public static double asDays(double secs) - Parameters:
secs
- Time in secs to convert- Returns:
- Secs expressed in days
-
asJulianYears
public double asJulianYears()- Specified by:
asJulianYears
in interfaceDuration
- Returns:
- duration expressed in Julian years
- See Also:
-
asJulianYears
public static double asJulianYears(double secs) - Parameters:
secs
- Time in secs to convert- Returns:
- Secs expressed in JulianYears
-
add
Description copied from interface:Duration
Add a duration to this one -
sub
Description copied from interface:Duration
Subtract a duration from this one -
clone
-