Package gaiasky.util.gaia.time
Class NanoSecs
java.lang.Object
gaiasky.util.gaia.time.ConcreteDuration
gaiasky.util.gaia.time.NanoSecs
- All Implemented Interfaces:
Duration
-
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
-
Method Summary
Modifier and TypeMethodDescriptionAdd a duration to this onedouble
asDays()
static double
asDays
(long nanoSecs) double
asHours()
static double
asHours
(long nanoSecs) double
static double
asJulianYears
(long nanoSecs) double
asMins()
static double
asMins
(long nanoSecs) long
double
asRevs()
static double
asRevs
(long nanoSecs) double
asSecs()
static double
asSecs
(long nanoSecs) clone()
mult
(double s) Multiply this duration by a given factornegate()
Set this duration to a new given oneSubtract a duration from this oneMethods inherited from class gaiasky.util.gaia.time.ConcreteDuration
getScale, isLongerThan, setScale
-
Constructor Details
-
NanoSecs
public NanoSecs()Default constructor -
NanoSecs
public NanoSecs(long ns) Construct object from number of nanoseconds.- Parameters:
ns
- The amount of nanoseconds.
-
-
Method Details
-
asSecs
public static double asSecs(long nanoSecs) - Parameters:
nanoSecs
- The nanoseconds.- Returns:
- nanoSecs expressed in s.
-
asMins
public static double asMins(long nanoSecs) - Parameters:
nanoSecs
- The amount of nanoseconds.- Returns:
- nanoSecs expressed in mins
-
asHours
public static double asHours(long nanoSecs) - Parameters:
nanoSecs
- The amount of nanoseconds.- Returns:
- nanoSecs expressed in hours
-
asRevs
public static double asRevs(long nanoSecs) - Parameters:
nanoSecs
- The amount of nanoseconds.- Returns:
- nanoSecs expressed in revs
-
asDays
public static double asDays(long nanoSecs) - Parameters:
nanoSecs
- the time in nanoseconds to convert.- Returns:
- nanoSecs expressed in days.
-
asJulianYears
public static double asJulianYears(long nanoSecs) - Parameters:
nanoSecs
- the time in nanoseconds to convert.- Returns:
- nanoSecs expressed in years.
-
set
Description copied from interface:Duration
Set this duration to a new given one- Parameters:
d
- duration to set this one to- Returns:
- updated object
- See Also:
-
asNanoSecs
public long asNanoSecs()- Returns:
- duration expressed in ns
- See Also:
-
asSecs
public double asSecs()- Returns:
- duration expressed in s
- See Also:
-
asMins
public double asMins()- Returns:
- duration expressed in min
- See Also:
-
asHours
public double asHours()- Returns:
- duration expressed in h
- See Also:
-
asRevs
public double asRevs()- Returns:
- duration expressed in revolutions
- See Also:
-
asDays
public double asDays()- Returns:
- number of ns expressed days
- See Also:
-
asJulianYears
public double asJulianYears()- Returns:
- duration expressed in Julian years
- See Also:
-
negate
- Specified by:
negate
in interfaceDuration
- Overrides:
negate
in classConcreteDuration
- Returns:
- negated amount of time
- See Also:
-
add
Description copied from interface:Duration
Add a duration to this one- Parameters:
d
- amount of time to add- Returns:
- updated object
- See Also:
-
sub
Description copied from interface:Duration
Subtract a duration from this one- Parameters:
d
- amount of time to subtract- Returns:
- updated object
- See Also:
-
mult
Description copied from interface:Duration
Multiply this duration by a given factor- Specified by:
mult
in interfaceDuration
- Overrides:
mult
in classConcreteDuration
- Parameters:
s
- scale factor- Returns:
- updated object
- See Also:
-
clone
-