|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Interval
Represents a time interval in years, months, days, hours, minutes, seconds. An interval can be converted to a string value by using the toString() method. The format of this string is described in the description of the toString() method.
toString()
Method Summary | |
---|---|
void |
clear()
Set all components of this interval to zero (in other words, 0 years, 0 months, 0 days, 0 hours, 0 minutes, 0 seconds |
Date |
computeDate(Date startdate)
Compute the date at the end of the interval assuming the given date marks the start of the interval. |
long |
computeTotalSeconds()
Get the computed number of seconds represented in this interval. |
long |
getDays()
Get the number of days represented in this interval. |
String |
getDescription()
Returns a string representation of an interval. |
long |
getHours()
Get the number of hours represented in this interval. |
long |
getMinutes()
Get the number of minutes represented in this interval. |
long |
getMonths()
Get the number of months represented in this interval. |
long |
getSeconds()
Get the number of seconds represented in this interval. |
long |
getYears()
Get the number of years represented in this interval. |
boolean |
isZero()
Is this duration of zero length? |
void |
setDays(long days)
Set the number of days represented in this interval. |
void |
setFromDescription(String interval)
Parse a string representation of an interval in <years>y<months>m<days>dt<hours>h<minutes>m<seconds>s
format and initialize this Interval instance with the parsed values. |
void |
setHours(long hours)
Set the number of hours represented in this interval. |
void |
setMinutes(long minutes)
Set the number of minutes represented in this interval. |
void |
setMonths(long months)
Set the number of months represented in this interval. |
void |
setSeconds(long seconds)
Set the number of seconds represented in this interval. |
void |
setYears(long years)
Set the number of years represented in this interval. |
String |
toString()
Get a string representation of this interval in <years>y<months>m<days>dt<hours>h<minutes>m<seconds>s
format. |
Method Detail |
---|
void clear()
boolean isZero()
long getYears()
void setYears(long years)
long getMonths()
void setMonths(long months)
long getDays()
void setDays(long days)
long getHours()
void setHours(long hours)
long getMinutes()
void setMinutes(long minutes)
long getSeconds()
void setSeconds(long seconds)
long computeTotalSeconds()
Date computeDate(Date startdate)
void setFromDescription(String interval)
<years>y<months>m<days>dt<hours>h<minutes>m<seconds>s
format and initialize this Interval instance with the parsed values.
For example, the interval with 1 years, 2 months, 3 days,
4 hours, 5 minutes, and 6 seconds would be represented as the string
1y2m3dt4h5m6s
interval
- The string version of the interval to set into this
Interval instance.String getDescription()
1 years, 2 months, 3 days, 4 hours, 5 minutes, and 6 seconds
String toString()
<years>y<months>m<days>dt<hours>h<minutes>m<seconds>s
format. For example, the interval with 1 years, 2 months, 3 days,
4 hours, 5 minutes, and 6 seconds would be represented as the string
1y2m3dt4h5m6s
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |