|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.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
|
Fields inherited from interface net.sf.saxon.expr.Expression |
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
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,
XPathContext context)
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 |
AtomicValue |
convertPrimitive(BuiltInAtomicType requiredType,
boolean validate)
Convert to target data type |
java.lang.Object |
convertToJava(java.lang.Class target,
XPathContext context)
Convert to Java object (for passing to external functions) |
DoubleValue |
divide(DurationValue other,
XPathContext context)
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()
Return a hash code to support the equals() function |
DurationValue |
multiply(double factor,
XPathContext context)
Multiply a duration by a number |
DurationValue |
subtract(DurationValue other,
XPathContext context)
Subtract two durations |
Methods inherited from class net.sf.saxon.value.AtomicValue |
checkPermittedContents, convert, convert, display, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getImplementationMethod, getLength, getPrimitiveValue, getStringValueCS, getTypedValue, hasBuiltInType, iterate, process, toString |
Methods inherited from class net.sf.saxon.value.Value |
analyze, asItem, asValue, collapseWhitespace, convert, convertJavaObjectToXPath, getDependencies, getIterator, getParentExpression, getSpecialProperties, itemAt, iterateSubExpressions, makeQNameValue, normalizeWhitespace, promote, simplify, stringToNumber, trimWhitespace |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, 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 convertPrimitive(BuiltInAtomicType requiredType, boolean validate)
convertPrimitive
in class AtomicValue
requiredType
- an integer identifying the required atomic typevalidate
- true if validation is required. If set to false, the caller guarantees that
the value is valid for the target data type, and that further validation is therefore not required.
Note that a validation failure may be reported even if validation was not requested.
public java.lang.String getStringValue()
getStringValue
in interface Item
getStringValue
in class AtomicValue
public double getLengthInSeconds()
public ItemType getItemType()
getItemType
in interface Expression
getItemType
in class Value
public java.lang.Object convertToJava(java.lang.Class target, XPathContext context) throws XPathException
convertToJava
in class Value
XPathException
public AtomicValue getComponent(int component) throws XPathException
getComponent
in class AtomicValue
XPathException
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
other
- 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 Value
public int hashCode()
Value
hashCode
in class Value
public DurationValue add(DurationValue other, XPathContext context) throws XPathException
XPathException
public DurationValue subtract(DurationValue other, XPathContext context) throws XPathException
XPathException
public DurationValue multiply(double factor, XPathContext context) throws XPathException
XPathException
public DoubleValue divide(DurationValue other, XPathContext context) throws XPathException
XPathException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |