|
XCC/J 3.2-9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.marklogic.xcc.types.Duration
The Duration class is a mutable class which implements the XdmDuration interface.
| Constructor Summary | |
Duration()
Construct a duration object, initialized to zero length. |
|
Duration(boolean negative,
int years,
int months,
int days,
int hours,
int minutes,
BigDecimal seconds)
Construct a duration object by specifying the individual values. |
|
Duration(String duration)
Construct a duration object initialized from the given string in the format of a serialized xs:duration item. |
|
| Method Summary | |
boolean |
equals(Object otherObj)
Compares this XdmDuration object to the specified object. |
int |
getDays()
|
int |
getHours()
|
int |
getMinutes()
|
int |
getMonths()
|
BigDecimal |
getSeconds()
|
long |
getWholeSeconds()
|
int |
getYears()
|
int |
hashCode()
|
boolean |
isNegative()
|
boolean |
isPositive()
|
void |
setDays(int days)
Sets the days value of this duration. |
void |
setHours(int hours)
Sets the hours value of this duration. |
void |
setMinutes(int minutes)
Sets the minutes value of this duration. |
void |
setMonths(int months)
Sets the months value of this duration. |
void |
setSign(boolean negative)
Sets the sign of this duration, either positive or negative. |
void |
setWholeSeconds(long seconds)
Sets the seconds value of this duration. |
void |
setYears(int years)
Sets the years value of this duration. |
String |
toString()
Formats this duration object as a String in the format prescribed in the W3C description of XML datatypes for a duration. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Duration()
public Duration(String duration)
duration - An xs:duration value as defined by
IllegalArgumentException - If the given string is
not a valid duration value.
public Duration(boolean negative,
int years,
int months,
int days,
int hours,
int minutes,
BigDecimal seconds)
negative - Pass true if the duration should be neagtive, otherwise false.years - The number of years.months - The number of months.days - The number of days.hours - The number of hours.minutes - The number of minutes.seconds - The (possibly fractional) number of seconds. Note
that this is specified by a BigDecimal object. If null,
a value of zero is assumed.| Method Detail |
public boolean isPositive()
isPositive in interface XdmDurationpublic boolean isNegative()
isNegative in interface XdmDurationpublic int getYears()
getYears in interface XdmDurationpublic int getMonths()
getMonths in interface XdmDurationpublic int getDays()
getDays in interface XdmDurationpublic int getHours()
getHours in interface XdmDurationpublic int getMinutes()
getMinutes in interface XdmDurationpublic long getWholeSeconds()
getWholeSeconds in interface XdmDurationpublic BigDecimal getSeconds()
getSeconds in interface XdmDurationpublic void setSign(boolean negative)
negative - If true, the duration is considered negative,
otherwise it's positive.public void setYears(int years)
years - the integer years value.public void setMonths(int months)
months - the integer months value.public void setDays(int days)
days - the integer days value.public void setHours(int hours)
hours - the integer hours value.public void setMinutes(int minutes)
minutes - the integer minutes value.public void setWholeSeconds(long seconds)
seconds - the integer seconds value.public boolean equals(Object otherObj)
XdmDuration object to the specified object. The
result is true if and only if the argument is not null and the
sign, year, month, day, hours, minutes, seconds and subseconds
values have the same value as this object.
otherObj - the Duration object to compare
public int hashCode()
public String toString()
|
XCC/J 3.2-9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com