public class Duration
extends java.lang.Object
| Constructor and Description |
|---|
Duration()
Instantiates a new duration.
|
Duration(int years)
Instantiates a new duration.
|
Duration(int years,
int months)
Instantiates a new duration.
|
Duration(int years,
int months,
int days)
Instantiates a new duration.
|
Duration(int years,
int months,
int days,
int hours)
Instantiates a new duration.
|
Duration(int years,
int months,
int days,
int hours,
int minutes)
Instantiates a new duration.
|
Duration(int years,
int months,
int days,
int hours,
int minutes,
int seconds)
Instantiates a new duration.
|
Duration(int years,
int months,
int days,
int hours,
int minutes,
int seconds,
int milliseconds)
Instantiates a new duration.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getDays()
Gets the days.
|
int |
getHours()
Gets the hours.
|
int |
getMilliseconds()
Gets the milliseconds.
|
int |
getMinutes()
Gets the minutes.
|
int |
getMonths()
Gets the months.
|
int |
getSeconds()
Gets the seconds.
|
int |
getYears()
Gets the years.
|
boolean |
isNegative()
Checks if is negative.
|
static Duration |
parse(java.lang.String duration)
Parses the.
|
void |
setDays(int days)
Sets the days.
|
void |
setHours(int hours)
Sets the hours.
|
void |
setMilliseconds(int milliseconds)
Sets the milliseconds.
|
void |
setMinutes(int minutes)
Sets the minutes.
|
void |
setMonths(int months)
Sets the months.
|
void |
setNegative(boolean isNegative)
Sets the negative.
|
void |
setSeconds(int seconds)
Sets the seconds.
|
void |
setYears(int years)
Sets the years.
|
java.lang.String |
toString() |
public Duration()
public Duration(int years)
years - the yearspublic Duration(int years,
int months)
years - the yearsmonths - the monthspublic Duration(int years,
int months,
int days)
years - the yearsmonths - the monthsdays - the dayspublic Duration(int years,
int months,
int days,
int hours)
years - the yearsmonths - the monthsdays - the dayshours - the hourspublic Duration(int years,
int months,
int days,
int hours,
int minutes)
years - the yearsmonths - the monthsdays - the dayshours - the hoursminutes - the minutespublic Duration(int years,
int months,
int days,
int hours,
int minutes,
int seconds)
years - the yearsmonths - the monthsdays - the dayshours - the hoursminutes - the minutesseconds - the secondspublic Duration(int years,
int months,
int days,
int hours,
int minutes,
int seconds,
int milliseconds)
years - the yearsmonths - the monthsdays - the dayshours - the hoursminutes - the minutesseconds - the secondsmilliseconds - the millisecondspublic static Duration parse(java.lang.String duration)
duration - the durationpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getYears()
public void setYears(int years)
years - the new yearspublic int getMonths()
public void setMonths(int months)
months - the new monthspublic int getDays()
public void setDays(int days)
days - the new dayspublic int getHours()
public void setHours(int hours)
hours - the new hourspublic int getMinutes()
public void setMinutes(int minutes)
minutes - the new minutespublic int getSeconds()
public void setSeconds(int seconds)
seconds - the new secondspublic int getMilliseconds()
public void setMilliseconds(int milliseconds)
milliseconds - the new millisecondspublic boolean isNegative()
public void setNegative(boolean isNegative)
isNegative - the new negative