Package gaiasky.util.gaia.time
Class ConcreteDuration
- java.lang.Object
-
- gaiasky.util.gaia.time.ConcreteDuration
-
- All Implemented Interfaces:
Duration
,java.io.Serializable
public abstract class ConcreteDuration extends java.lang.Object implements Duration
AConcreteDuration
is a duration that is linked to a time scale- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double
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 Constructor Description ConcreteDuration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeScale
getScale()
boolean
isLongerThan(Duration d)
Check that this duration is longer than a given oneDuration
mult(double s)
Multiply this duration by a given factorDuration
negate()
void
setScale(TimeScale scale)
Set the time scale for this duration
-
-
-
Method Detail
-
getScale
public TimeScale getScale()
-
setScale
public void setScale(TimeScale scale)
Description copied from interface:Duration
Set the time scale for this duration
-
negate
public Duration negate()
- Specified by:
negate
in interfaceDuration
- Returns:
- negated amount of time
- See Also:
Duration.negate()
-
mult
public Duration mult(double s)
Description copied from interface:Duration
Multiply this duration by a given factor- Specified by:
mult
in interfaceDuration
- Parameters:
s
- scale factor- Returns:
- updated object
- See Also:
Duration.mult(double)
-
isLongerThan
public boolean isLongerThan(Duration d)
Description copied from interface:Duration
Check that this duration is longer than a given one- Specified by:
isLongerThan
in interfaceDuration
- Parameters:
d
- duration to compare to- Returns:
true
if this duration is longer thand
- See Also:
Duration.isLongerThan(gaiasky.util.gaia.time.Duration)
-
-