|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.time.BaseDuration groovy.time.Duration groovy.time.TimeDuration
public class TimeDuration extends Duration
TimeDuration represents time periods expressed in units of hours, minutes, seconds and milliseconds.
Whilst we can't say how long a month is without knowing the year and the name of the month, we know how long a second is independent of the date.
This is not 100% true for minutes. Minutes can be 59, 60 or 61 seconds long (due to leap seconds.)
If you ask Duration to convert itself to milliseconds then it will work on the basis of 60 seconds in a minute. If you add or subtract it from a date it will take leap seconds into account.
Field Summary |
---|
Fields inherited from class BaseDuration | |
---|---|
days, hours, millis, minutes, months, seconds, years |
Constructor Summary | |
TimeDuration(int hours, int minutes, int seconds, int millis)
|
|
TimeDuration(int days, int hours, int minutes, int seconds, int millis)
|
Method Summary | |
---|---|
Date
|
getAgo()
|
From
|
getFrom()
|
Duration
|
minus(Duration rhs)
|
DatumDependentDuration
|
minus(DatumDependentDuration rhs)
|
Duration
|
plus(Duration rhs)
|
DatumDependentDuration
|
plus(DatumDependentDuration rhs)
|
Methods inherited from class Duration | |
---|---|
getAgo, getFrom, minus, minus, minus, minus, plus, plus, plus, toMilliseconds |
Methods inherited from class BaseDuration | |
---|---|
compareTo, getAgo, getDays, getFrom, getHours, getMillis, getMinutes, getMonths, getSeconds, getYears, plus, toMilliseconds, toString |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail |
---|
public TimeDuration(int hours, int minutes, int seconds, int millis)
public TimeDuration(int days, int hours, int minutes, int seconds, int millis)
Method Detail |
---|
public Date getAgo()
public From getFrom()
public Duration minus(Duration rhs)
public DatumDependentDuration minus(DatumDependentDuration rhs)
public Duration plus(Duration rhs)
public DatumDependentDuration plus(DatumDependentDuration rhs)
Copyright © 2003-2013 The Codehaus. All rights reserved.