Package gaiasky.util.gaia.time
Interface Duration
- All Known Implementing Classes:
ConcreteDuration
,Days
,Hours
,JulianYears
,Mins
,NanoSecs
,Revs
,Secs
public interface Duration
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
static final double
static final double
static final double
static final double
static final double
static final double
static final double
static final double
static final long
static final double
static final long
static final double
static final long
static final double
static final long
static final double
static final long
static final long
A few obvious constantsstatic final double
static final double
static final double
static final double
static final double
static final double
static final double
-
Method Summary
Modifier and TypeMethodDescriptionAdd a duration to this onedouble
asDays()
double
asHours()
double
double
asMins()
long
double
asRevs()
double
asSecs()
getScale()
boolean
Check that this duration is longer than a given onemult
(double s) Multiply this duration by a given factornegate()
Set this duration to a new given onevoid
Set the time scale for this durationSubtract a duration from this one
-
Field Details
-
NS_PER_SEC
static final long NS_PER_SECA few obvious constants- See Also:
-
SECS_PER_MIN
static final double SECS_PER_MIN- See Also:
-
MINS_PER_HOUR
static final double MINS_PER_HOUR- See Also:
-
HOURS_PER_DAY
static final double HOURS_PER_DAY- See Also:
-
DAYS_PER_JULIAN_YEAR
static final double DAYS_PER_JULIAN_YEAR- See Also:
-
HOURS_PER_REV
static final double HOURS_PER_REV- See Also:
-
REVS_PER_DAY
static final double REVS_PER_DAY- See Also:
-
REVS_PER_JULIAN_YEAR
static final double REVS_PER_JULIAN_YEAR- See Also:
-
HOURS_PER_JULIAN_YEAR
static final double HOURS_PER_JULIAN_YEAR- See Also:
-
MINS_PER_JULIAN_YEAR
static final double MINS_PER_JULIAN_YEAR- See Also:
-
SECS_PER_JULIAN_YEAR
static final double SECS_PER_JULIAN_YEAR- See Also:
-
NS_PER_JULIAN_YEAR
static final double NS_PER_JULIAN_YEAR- See Also:
-
NS_PER_JULIAN_YEAR_L
static final long NS_PER_JULIAN_YEAR_L- See Also:
-
MINS_PER_DAY
static final double MINS_PER_DAY- See Also:
-
SECS_PER_DAY
static final double SECS_PER_DAY- See Also:
-
NS_PER_DAY
static final double NS_PER_DAY- See Also:
-
NS_PER_DAY_L
static final long NS_PER_DAY_L- See Also:
-
MINS_PER_REV
static final double MINS_PER_REV- See Also:
-
SECS_PER_REV
static final double SECS_PER_REV- See Also:
-
NS_PER_REV
static final double NS_PER_REV- See Also:
-
NS_PER_REV_L
static final long NS_PER_REV_L- See Also:
-
SECS_PER_HOUR
static final double SECS_PER_HOUR- See Also:
-
NS_PER_HOUR
static final double NS_PER_HOUR- See Also:
-
NS_PER_HOUR_L
static final long NS_PER_HOUR_L- See Also:
-
NS_PER_MIN
static final double NS_PER_MIN- See Also:
-
NS_PER_MIN_L
static final long NS_PER_MIN_L- See Also:
-
-
Method Details
-
set
Set this duration to a new given one- Parameters:
d
- duration to set this one to- Returns:
- updated object
-
asNanoSecs
long asNanoSecs()- Returns:
- duration expressed in ns
-
asSecs
double asSecs()- Returns:
- duration expressed in s
-
asMins
double asMins()- Returns:
- duration expressed in min
-
asHours
double asHours()- Returns:
- duration expressed in h
-
asDays
double asDays()- Returns:
- number of ns expressed days
-
asJulianYears
double asJulianYears()- Returns:
- duration expressed in Julian years
-
asRevs
double asRevs()- Returns:
- duration expressed in revolutions
-
negate
Duration negate()- Returns:
- negated amount of time
-
add
Add a duration to this one- Parameters:
d
- amount of time to add- Returns:
- updated object
-
sub
Subtract a duration from this one- Parameters:
d
- amount of time to subtract- Returns:
- updated object
-
isLongerThan
Check that this duration is longer than a given one- Parameters:
d
- duration to compare to- Returns:
true
if this duration is longer thand
-
mult
Multiply this duration by a given factor- Parameters:
s
- scale factor- Returns:
- updated object
-
getScale
TimeScale getScale()- Returns:
- Current time scale of the duration
-
setScale
Set the time scale for this duration- Parameters:
scale
- time scale to set the duration to
-