|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectDuration
Creates an XML-Schema-style Duration object.
| Field Summary | |
protected int |
days
|
protected int |
hours
|
protected int |
minutes
|
protected int |
months
|
protected boolean |
negative
|
protected double |
seconds
|
protected int |
years
|
| Constructor Summary | |
Duration()
Create a new Duration with all fields
set to zero. |
|
Duration(int years,
int months,
int days)
Create a new Duration with
years, months and days
set as specified. |
|
Duration(int years,
int months,
int days,
int hours,
int minutes,
double seconds)
Create a new Duration with all
numeric fields set as specified. |
|
| Method Summary | |
int |
getDays()
Returns the number of years of this Duration. |
int |
getHours()
Returns the number of years of this Duration. |
int |
getMinutes()
Returns the number of years of this Duration. |
int |
getMonths()
Returns the number of years of this Duration. |
double |
getSeconds()
Returns the number of years of this Duration. |
int |
getYears()
Returns the number of years of this Duration. |
boolean |
isNegative()
Returns the negative status Duration. |
static Duration |
parseDuration(String str)
Parses the string argument as a Duration. |
void |
setDays(int days)
Sets the number of days of this Duration to
the specified value. |
void |
setHours(int hours)
Sets the number of hours of this Duration to
the specified value. |
void |
setMinutes(int minutes)
Sets the number of minutes of this Duration to
the specified value. |
void |
setMonths(int months)
Sets the number of months of this Duration to
the specified value. |
void |
setNegative(boolean negative)
Sets the negative status of this Duration to
the specified value. |
void |
setSeconds(double seconds)
Sets the number of seconds of this Duration to
the specified value. |
void |
setYears(int years)
Sets the number of years of this Duration to
the specified value. |
String |
toString()
Returns a string representation of this Duration. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int years
protected int months
protected int days
protected int hours
protected int minutes
protected double seconds
protected boolean negative
| Constructor Detail |
public Duration()
Duration with all fields
set to zero.
public Duration(int years,
int months,
int days)
Duration with
years, months and days
set as specified.
years - the number of years.months - the number of months.days - the number of days
public Duration(int years,
int months,
int days,
int hours,
int minutes,
double seconds)
Duration with all
numeric fields set as specified.
years - the number of years.months - the number of months.days - the number of dayshours - the number of hours.minutes - the number of minutes.seconds - the number of seconds.| Method Detail |
public int getYears()
Duration.
Duration.public void setYears(int years)
Duration to
the specified value.
years - the number of years.public int getMonths()
Duration.
Duration.public void setMonths(int months)
Duration to
the specified value.
months - the number of months.public int getDays()
Duration.
Duration.public void setDays(int days)
Duration to
the specified value.
days - the number of days.public int getHours()
Duration.
Duration.public void setHours(int hours)
Duration to
the specified value.
hours - the number of hours.public int getMinutes()
Duration.
Duration.public void setMinutes(int minutes)
Duration to
the specified value.
minutes - the number of minutes.public double getSeconds()
Duration.
Duration.public void setSeconds(double seconds)
Duration to
the specified value.
seconds - the number of seconds.public boolean isNegative()
Duration.
negative field of
this Duration.public void setNegative(boolean negative)
Duration to
the specified value.
negative - the negative status.public static Duration parseDuration(String str)
Duration.
The format of the string should be
PyyYmmMddDThhHmmMssS with an optional leading
minus sign. The seconds may contain a decimal point.
str - the string to parse
Duration specified by the string.public String toString()
Duration.
Duration.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||