|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--net.sf.saxon.value.Value
|
+--net.sf.saxon.value.AtomicValue
|
+--net.sf.saxon.value.DurationValue
A value of type xs:duration
| Field Summary | |
protected int |
days
|
protected int |
hours
|
protected int |
milliseconds
|
protected int |
minutes
|
protected int |
months
|
protected boolean |
negative
|
protected int |
seconds
|
protected int |
years
|
| Constructor Summary | |
protected |
DurationValue()
Private constructor for internal use |
|
DurationValue(java.lang.CharSequence s)
Constructor: create a duration value from a supplied string, in ISO 8601 format [+|-]PnYnMnDTnHnMnS |
| Method Summary | |
DurationValue |
add(DurationValue other)
Add two durations |
protected void |
badDuration(java.lang.String msg,
java.lang.CharSequence s)
|
int |
compareTo(java.lang.Object other)
Compare the value to another duration value |
int |
conversionPreference(java.lang.Class required,
Configuration config)
Get conversion preference for this value to a Java class. |
AtomicValue |
convert(int requiredType)
Convert to target data type |
java.lang.Object |
convertToJava(java.lang.Class target,
Configuration config)
Convert to Java object (for passing to external functions) |
void |
display(int level,
NamePool pool)
Diagnostic print of expression structure |
DoubleValue |
divide(DurationValue other)
Divide a duration by a number |
boolean |
equals(java.lang.Object other)
Test if the two durations are of equal length. |
AtomicValue |
getComponent(int component)
Get a component of the value |
ItemType |
getItemType()
Determine the data type of the exprssion |
double |
getLengthInSeconds()
Get length of duration in seconds, assuming an average length of month. |
java.lang.String |
getStringValue()
Convert to string |
int |
hashCode()
|
DurationValue |
multiply(double factor)
Multiply a duration by a number |
DurationValue |
subtract(DurationValue other)
Subtract two durations |
| Methods inherited from class net.sf.saxon.value.AtomicValue |
convert, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getPrimitiveValue, getTypedValue, iterate |
| Methods inherited from class net.sf.saxon.value.Value |
analyze, asItem, asValue, collapseWhitespace, getDependencies, getSpecialProperties, getSubExpressions, inverse, normalizeWhitespace, promote, simplify, stringToNumber, trimWhitespace |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean negative
protected int years
protected int months
protected int days
protected int hours
protected int minutes
protected int seconds
protected int milliseconds
| Constructor Detail |
protected DurationValue()
public DurationValue(java.lang.CharSequence s)
throws XPathException
| Method Detail |
protected void badDuration(java.lang.String msg,
java.lang.CharSequence s)
throws XPathException
XPathException
public AtomicValue convert(int requiredType)
throws XPathException
convert in class AtomicValuerequiredType - an integer identifying the required atomic type
XPathException - if the conversion is not possiblepublic java.lang.String getStringValue()
getStringValue in interface ItemgetStringValue in class Valuepublic double getLengthInSeconds()
public ItemType getItemType()
getItemType in interface Expression
public int conversionPreference(java.lang.Class required,
Configuration config)
conversionPreference in class AtomicValue
public java.lang.Object convertToJava(java.lang.Class target,
Configuration config)
throws XPathException
convertToJava in class AtomicValuetarget - The class required by the external functionconfig - The configuration (needed for access to schema information)
XPathException
public AtomicValue getComponent(int component)
throws XPathException
getComponent in class AtomicValueXPathExceptionpublic int compareTo(java.lang.Object other)
compareTo in interface java.lang.Comparableother - The other dateTime value
java.lang.ClassCastException - if the other value is not a DurationValue (the parameter
is declared as Object to satisfy the Comparable interface)public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
public DurationValue add(DurationValue other)
throws XPathException
XPathException
public DurationValue subtract(DurationValue other)
throws XPathException
XPathException
public DurationValue multiply(double factor)
throws XPathException
XPathException
public DoubleValue divide(DurationValue other)
throws XPathException
XPathException
public void display(int level,
NamePool pool)
display in interface Expressionlevel - indentation level for this expression
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||