

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
public interface Duration
Represents a duration of time. A duration is a standard span of time that does not depend on any specific date or calendar representation. It has methods for getting the standard time components of the span for standard milliseconds (1ms), seconds(1s=1000ms), minutes (1m=60s), hours (1h=60m), and days (1d=24h). Durations can be either positive or negative. The reason this interface exists is that date/time API designs have advanced much beyond the original Java date/time classes. Java may revise these at some point, but we have a need for interfacing with a lot of timebased data, so we have created this interface. In the future, if Java changes its time APIs, those can either be adapted to this interface or this interface could be deprecated. The design of the interface is based on Joda time, .NET TimeSpan, and JavaFX Duration.
Method Summary  

Duration 
absoluteValue()
Returns the absolute value of this duration. 
Duration 
divide(double scalar)
Divides this duration by the given scalar value and returns the result. 
double 
divide(Duration other)
Divides this duration by the given duration and returns the ratio. 
boolean 
equals(Duration other)
Determines if this duration is equivalent to the given duration. 
long 
getDaysPart()
Gets the standard minutes part of the time. 
int 
getHoursPart()
Gets the standard hours part of the time. 
int 
getMillisecondsPart()
Gets the standard milliseconds part of the time. 
int 
getMinutesPart()
Gets the standard minutes part of the time. 
int 
getSecondsPart()
Gets the standard seconds part of the time. 
double 
getTotalDays()
Gets the total number of standard days of this duration. 
double 
getTotalHours()
Gets the total number of standard hours of this duration. 
double 
getTotalMilliseconds()
Gets the total number of standard milliseconds of this duration. 
double 
getTotalMinutes()
Gets the total number of standard minutes of this duration. 
double 
getTotalSeconds()
Gets the total number of standard seconds of this duration. 
Duration 
minus(Duration other)
Subtracts the given duration from this duration and returns the difference. 
Duration 
negative()
Returns the negative of this duration. 
Duration 
plus(Duration other)
Adds this duration to the given duration and returns the sum. 
Duration 
times(double scalar)
Multiplies this duration by the given scalar value and returns the product. 
Methods inherited from interface java.lang.Comparable 

compareTo 
Method Detail 

Duration negative()
Duration absoluteValue()
boolean equals(Duration other)
other
 The other duration.
Duration plus(Duration other)
other
 The other duration.
Duration minus(Duration other)
other
 The other duration.
Duration times(double scalar)
scalar
 The scalar value.
double divide(Duration other)
other
 The other duration.
Duration divide(double scalar)
scalar
 The scalar value.
double getTotalMilliseconds()
double getTotalSeconds()
double getTotalMinutes()
double getTotalHours()
double getTotalDays()
int getMillisecondsPart()
int getSecondsPart()
int getMinutesPart()
int getHoursPart()
long getDaysPart()


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 