|
|||||||||
| 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
public class 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(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(String msg,
CharSequence s)
|
int |
compareTo(Object other)
Compare the value to another duration value |
int |
conversionPreference(Class required)
Get conversion preference for this value to a Java class. |
AtomicValue |
convert(int requiredType)
Convert to target data type |
Object |
convertToJava(Class target)
Convert to Java object (for passing to external functions) |
void |
display(int level,
NamePool pool)
Diagnostic print of expression structure |
boolean |
equals(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. |
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, 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, stringToInteger, 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(CharSequence s)
throws XPathException
XPathException| Method Detail |
|---|
protected void badDuration(String msg,
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 String getStringValue()
getStringValue in interface Itempublic double getLengthInSeconds()
public ItemType getItemType()
getItemType in interface Expressionpublic int conversionPreference(Class required)
conversionPreference in class AtomicValue
public Object convertToJava(Class target)
throws XPathException
convertToJava in class AtomicValuetarget - The class required by the external function
XPathException
public AtomicValue getComponent(int component)
throws XPathException
getComponent in class AtomicValueXPathExceptionpublic int compareTo(Object other)
compareTo in interface Comparableother - The other dateTime value
ClassCastException - if the other value is not a DurationValue (the parameter
is declared as Object to satisfy the Comparable interface)public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class 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 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 | ||||||||