Package com.independentsoft.graph
Class Duration
java.lang.Object
com.independentsoft.graph.Duration
The Class Duration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetDays()Gets the days.intgetHours()Gets the hours.intGets the milliseconds.intGets the minutes.intGets the months.intGets the seconds.intgetYears()Gets the years.booleanChecks if is negative.voidsetDays(int days)Sets the days.voidsetHours(int hours)Sets the hours.voidsetMilliseconds(int milliseconds)Sets the milliseconds.voidsetMinutes(int minutes)Sets the minutes.voidsetMonths(int months)Sets the months.voidsetNegative(boolean isNegative)Sets the negative.voidsetSeconds(int seconds)Sets the seconds.voidsetYears(int years)Sets the years.toString()
-
Constructor Details
-
Duration
public Duration()Instantiates a new duration. -
Duration
public Duration(int hours)Instantiates a new duration.- Parameters:
hours- the hours
-
Duration
public Duration(int hours, int minutes)Instantiates a new duration.- Parameters:
hours- the hoursminutes- the minutes
-
Duration
public Duration(int hours, int minutes, int seconds)Instantiates a new duration.- Parameters:
hours- the hoursminutes- the minutesseconds- the seconds
-
Duration
Instantiates a new duration from a string.- Parameters:
duration- the duration
-
-
Method Details
-
toString
-
getYears
public int getYears()Gets the years.- Returns:
- the years
-
setYears
public void setYears(int years)Sets the years.- Parameters:
years- the new years
-
getMonths
public int getMonths()Gets the months.- Returns:
- the months
-
setMonths
public void setMonths(int months)Sets the months.- Parameters:
months- the new months
-
getDays
public int getDays()Gets the days.- Returns:
- the days
-
setDays
public void setDays(int days)Sets the days.- Parameters:
days- the new days
-
getHours
public int getHours()Gets the hours.- Returns:
- the hours
-
setHours
public void setHours(int hours)Sets the hours.- Parameters:
hours- the new hours
-
getMinutes
public int getMinutes()Gets the minutes.- Returns:
- the minutes
-
setMinutes
public void setMinutes(int minutes)Sets the minutes.- Parameters:
minutes- the new minutes
-
getSeconds
public int getSeconds()Gets the seconds.- Returns:
- the seconds
-
setSeconds
public void setSeconds(int seconds)Sets the seconds.- Parameters:
seconds- the new seconds
-
getMilliseconds
public int getMilliseconds()Gets the milliseconds.- Returns:
- the milliseconds
-
setMilliseconds
public void setMilliseconds(int milliseconds)Sets the milliseconds.- Parameters:
milliseconds- the new milliseconds
-
isNegative
public boolean isNegative()Checks if is negative.- Returns:
- true, if is negative
-
setNegative
public void setNegative(boolean isNegative)Sets the negative.- Parameters:
isNegative- the new negative
-