Overview
A class that defines a duration of time. Duration instances are defined in
milliseconds, but can be easily created using time literals; for
example, a two-and-a-half minute Duration instance can be defined in several
ways:
Duration t = 2m + 30s;
Duration t = 2.5m;
Duration t = 2500ms;
Profile: common
Attribute Summary
name | type | description |
---|---|---|
Public | ||
millis | Number |
The duration of time, as expressed in milliseconds. More: [+]The duration of time, as expressed in milliseconds. Profile: common |
Protected |
Inherited Attributes
Function Summary
- public add(other: Duration) : Duration
-
Add this instance and another Duration instance to return a new Duration instance.
More: [+]Add this instance and another Duration instance to return a new Duration instance. This function does not change the value of called Duration instance.
-
Parameters
- other
-
Returns
- Duration
Profile: common
- public compareTo(obj: java.lang.Object) : Integer
-
More: [+]
-
Parameters
- obj
-
Returns
- Integer
Profile: common
- public div(n: Number) : Duration
-
Divide this instance by a number to return a new Duration instance.
More: [+]Divide this instance by a number to return a new Duration instance. This function does not change the value of called Duration instance.
-
Parameters
- n
-
Returns
- Duration
Profile: common
- public equals(obj: java.lang.Object) : Boolean
-
More: [+]
-
Parameters
- obj
-
Returns
- Boolean
Profile: common
- public ge(other: Duration) : Boolean
-
More: [+]
-
Parameters
- other
-
Returns
- Boolean
Profile: common
- public gt(other: Duration) : Boolean
-
More: [+]
-
Parameters
- other
-
Returns
- Boolean
Profile: common
- public hashCode() : Integer
-
More: [+]
-
Returns
- Integer
Profile: common
- public le(other: Duration) : Boolean
-
More: [+]
-
Parameters
- other
-
Returns
- Boolean
Profile: common
- public lt(other: Duration) : Boolean
-
More: [+]
-
Parameters
- other
-
Returns
- Boolean
Profile: common
- public mul(n: Number) : Duration
-
Multiply this instance with a number to return a new Duration instance.
More: [+]Multiply this instance with a number to return a new Duration instance. This function does not change the value of called Duration instance.
-
Parameters
- n
-
Returns
- Duration
Profile: common
- public negate() : Duration
-
More: [+]
-
Returns
- Duration
Profile: common
- public sub(other: Duration) : Duration
-
Subtract this instance from another Duration instance to return a new Duration instance.
More: [+]Subtract this instance from another Duration instance to return a new Duration instance. This function does not change the value of called Duration instance.
-
Parameters
- other
-
Returns
- Duration
Profile: common
- public toDate() : java.util.Date
-
More: [+]
-
Returns
- Date
Profile: common
- public toHours() : Number
-
Returns the number of whole hours in this period.
More: [+]Returns the number of whole hours in this period.
-
Returns
- Number
Profile: common
- public toMillis() : Number
-
Returns the number of milliseconds in this period.
More: [+]Returns the number of milliseconds in this period.
-
Returns
- Number
Profile: common
- public toMinutes() : Number
-
Returns the number of whole minutes in this period.
More: [+]Returns the number of whole minutes in this period.
-
Returns
- Number
Profile: common
- public toSeconds() : Number
-
Returns the number of whole seconds in this period.
More: [+]Returns the number of whole seconds in this period.
-
Returns
- Number
Profile: common
- public toString() : java.lang.String
-
More: [+]
-
Returns
- String
Profile: common