blob: f72fb920f4936b47c1d097a5d830bc56abefc6a5 [file] [log] [blame]
<html><body><p><font size="+1"><strong>Package org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font></p><hr><h2><font size="-1"><strong>org.eclipse.wst.xml.xpath2.processor.internal.types</strong></font><br>
Class XSDuration</h2><br><hr><pre>public class <strong>XSDuration</strong>
extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrType</pre>A representation of the xs:duration data type. Other duration implementations
should inherit from this implementation.<p></p><hr><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Field Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>protected int</code></td><td width="80%" align="left"><code><a href="#field__days">_days</a></code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr valign="top"><td width="20%" align="right"><code>protected int</code></td><td width="80%" align="left"><code><a href="#field__hours">_hours</a></code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr valign="top"><td width="20%" align="right"><code>protected int</code></td><td width="80%" align="left"><code><a href="#field__minutes">_minutes</a></code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr valign="top"><td width="20%" align="right"><code>protected int</code></td><td width="80%" align="left"><code><a href="#field__month">_month</a></code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="80%" align="left"><code><a href="#field__negative">_negative</a></code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr valign="top"><td width="20%" align="right"><code>protected double</code></td><td width="80%" align="left"><code><a href="#field__seconds">_seconds</a></code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr valign="top"><td width="20%" align="right"><code>protected int</code></td><td width="80%" align="left"><code><a href="#field__year">_year</a></code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr></table><br><table width="100%" border="1"><tr bgcolor="#CCCCFF"><td width="100%"><h2>Constructor Summary</h2></td></tr><tr><td><code><strong><a href="#con_XSDuration">XSDuration</a></strong>(int years
,
int months
,
int days
,
int hours
,
int minutes
,
double seconds
,
boolean negative)</code></td></tr><tr><td><code><strong><a href="#con_XSDuration">XSDuration</a></strong>(double secs)</code></td></tr><tr><td><code><strong><a href="#con_XSDuration">XSDuration</a></strong>()</code></td></tr></table><br><table width="100%" border="1"><tr cols="2" bgcolor="#CCCCFF"><td colspan="2" width="100%"><h2>Method Summary</h2></td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.Object</code></td><td width="" align="left"><code><a href="#method_clone">clone</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr valign="top"><td width="20%" align="right"><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence</code></td><td width="" align="left"><code><a href="#method_constructor">constructor</a>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Creates a new ResultSequence consisting of the extractable time duration
from the supplied ResultSequence</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_days">days</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Retrieves the number of days within the duration of time stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_eq">eq</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Equality comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_gt">gt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_hours">hours</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Retrieves the number of hours (max 24) within the duration of time stored</td></tr><tr valign="top"><td width="20%" align="right"><code>protected boolean</code></td><td width="" align="left"><code><a href="#method_isCastable">isCastable</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_lt">lt</a>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Comparison between this and the supplied duration of time.</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_minutes">minutes</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Retrieves the number of minutes (max 60) within the duration of time
stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_month">month</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Retrieves the number of months within the duration of time stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public boolean</code></td><td width="" align="left"><code><a href="#method_negative">negative</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Retrieves whether this duration represents a backward passage through
time</td></tr><tr valign="top"><td width="20%" align="right"><code>public static org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code></td><td width="" align="left"><code><a href="#method_parseDTDuration">parseDTDuration</a>(java.lang.String str)</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Creates a new XSDayTimeDuration by parsing the supplied String
represented duration of time</td></tr><tr valign="top"><td width="20%" align="right"><code>public double</code></td><td width="" align="left"><code><a href="#method_seconds">seconds</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Retrieves the number of seconds (max 60) within the duration of time
stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_type">string_type</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_string_value">string_value</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Retrieves a String representation of the duration stored</td></tr><tr valign="top"><td width="20%" align="right"><code>public double</code></td><td width="" align="left"><code><a href="#method_time_value">time_value</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr valign="top"><td width="20%" align="right"><code>public java.lang.String</code></td><td width="" align="left"><code><a href="#method_type_name">type_name</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr valign="top"><td width="20%" align="right"><code>public double</code></td><td width="" align="left"><code><a href="#method_value">value</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Retrieves the duration of time stored as the number of seconds within it</td></tr><tr valign="top"><td width="20%" align="right"><code>public int</code></td><td width="" align="left"><code><a href="#method_year">year</a>()</code><br>
&nbsp;&nbsp;&nbsp;&nbsp;
Retrieves the number of years within the duration of time stored</td></tr></table><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
Field Detail
</h2></td></tr></table><h2><a name="field__days">_days</a></h2><p><code>protected int <strong>_days</strong></code></p><hr><h2><a name="field__hours">_hours</a></h2><p><code>protected int <strong>_hours</strong></code></p><hr><h2><a name="field__minutes">_minutes</a></h2><p><code>protected int <strong>_minutes</strong></code></p><hr><h2><a name="field__month">_month</a></h2><p><code>protected int <strong>_month</strong></code></p><hr><h2><a name="field__negative">_negative</a></h2><p><code>protected boolean <strong>_negative</strong></code></p><hr><h2><a name="field__seconds">_seconds</a></h2><p><code>protected double <strong>_seconds</strong></code></p><hr><h2><a name="field__year">_year</a></h2><p><code>protected int <strong>_year</strong></code></p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
Constructor Detail
</h2></td></tr></table><h2><a name="con_XSDuration">XSDuration</a></h2><p><code>public <strong>XSDuration</strong>(int years
,
int months
,
int days
,
int hours
,
int minutes
,
double seconds
,
boolean negative)</code></p><p>Initializes to the supplied parameters. If more than 24 hours is
supplied, the number of days is adjusted accordingly. The same occurs for
minutes and seconds</p><hr><h2><a name="con_XSDuration">XSDuration</a></h2><p><code>public <strong>XSDuration</strong>(double secs)</code></p><p>Initialises to the given number of seconds</p><hr><h2><a name="con_XSDuration">XSDuration</a></h2><p><code>public <strong>XSDuration</strong>()</code></p><p>Initialises to a duration of no time (0days, 0hours, 0minutes, 0seconds)</p><hr><table cols="2" width="100%" border="1"><tr colspan="2" width="100%" bgcolor="#CCCCFF" align="left"><td><h2>
Methods Detail
</h2></td></tr></table><h2><a name="method_clone">clone</a></h2><p><code>public java.lang.Object <strong>clone</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.Object</code></p><h3>Throws:</h3><p><code>java.lang.CloneNotSupportedException</code></p><hr><h2><a name="method_constructor">constructor</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.ResultSequence <strong>constructor</strong>(org.eclipse.wst.xml.xpath2.processor.ResultSequence arg)</code></p><p>Creates a new ResultSequence consisting of the extractable time duration
from the supplied ResultSequence</p><h3>Parameters</h3><p><code>arg</code> - The ResultSequence from which to extract</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.ResultSequence</code> - New ResultSequence consisting of the time duration extracted</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_days">days</a></h2><p><code>public int <strong>days</strong>()</code></p><p>Retrieves the number of days within the duration of time stored</p><h3>Returns</h3><p><code>int</code> - Number of days within the duration of time stored</p><hr><h2><a name="method_eq">eq</a></h2><p><code>public boolean <strong>eq</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Equality comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if they both represent the duration of time. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_gt">gt</a></h2><p><code>public boolean <strong>gt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represents a smaller duration than that stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_hours">hours</a></h2><p><code>public int <strong>hours</strong>()</code></p><p>Retrieves the number of hours (max 24) within the duration of time stored</p><h3>Returns</h3><p><code>int</code> - Number of hours within the duration of time stored</p><hr><h2><a name="method_isCastable">isCastable</a></h2><p><code>protected boolean <strong>isCastable</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)</code></p><p></p><h3>Parameters</h3><p><code>aat</code></p><h3>Returns</h3><p><code>boolean</code></p><hr><h2><a name="method_lt">lt</a></h2><p><code>public boolean <strong>lt</strong>(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.processor.DynamicContext context)</code></p><p>Comparison between this and the supplied duration of time.</p><h3>Parameters</h3><p><code>arg</code> - The duration of time to compare with</p><p><code>context</code></p><h3>Returns</h3><p><code>boolean</code> - True if the supplied time represents a larger duration than that stored. False otherwise</p><h3>Throws:</h3><p><code>org.eclipse.wst.xml.xpath2.processor.DynamicError</code></p><hr><h2><a name="method_minutes">minutes</a></h2><p><code>public int <strong>minutes</strong>()</code></p><p>Retrieves the number of minutes (max 60) within the duration of time
stored</p><h3>Returns</h3><p><code>int</code> - Number of minutes within the duration of time stored</p><hr><h2><a name="method_month">month</a></h2><p><code>public int <strong>month</strong>()</code></p><p>Retrieves the number of months within the duration of time stored</p><h3>Returns</h3><p><code>int</code> - Number of months within the duration of time stored</p><hr><h2><a name="method_negative">negative</a></h2><p><code>public boolean <strong>negative</strong>()</code></p><p>Retrieves whether this duration represents a backward passage through
time</p><h3>Returns</h3><p><code>boolean</code> - True if this duration represents a backward passage through time. False otherwise</p><hr><h2><a name="method_parseDTDuration">parseDTDuration</a></h2><p><code>public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration <strong>parseDTDuration</strong>(java.lang.String str)</code></p><p>Creates a new XSDayTimeDuration by parsing the supplied String
represented duration of time</p><h3>Parameters</h3><p><code>str</code> - String represented duration of time</p><h3>Returns</h3><p><code>org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration</code> - New XSDayTimeDuration representing the duration of time supplied</p><hr><h2><a name="method_seconds">seconds</a></h2><p><code>public double <strong>seconds</strong>()</code></p><p>Retrieves the number of seconds (max 60) within the duration of time
stored</p><h3>Returns</h3><p><code>double</code> - Number of seconds within the duration of time stored</p><hr><h2><a name="method_string_type">string_type</a></h2><p><code>public java.lang.String <strong>string_type</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_string_value">string_value</a></h2><p><code>public java.lang.String <strong>string_value</strong>()</code></p><p>Retrieves a String representation of the duration stored</p><h3>Returns</h3><p><code>java.lang.String</code> - String representation of the duration stored</p><hr><h2><a name="method_time_value">time_value</a></h2><p><code>public double <strong>time_value</strong>()</code></p><p></p><h3>Returns</h3><p><code>double</code></p><hr><h2><a name="method_type_name">type_name</a></h2><p><code>public java.lang.String <strong>type_name</strong>()</code></p><p></p><h3>Returns</h3><p><code>java.lang.String</code></p><hr><h2><a name="method_value">value</a></h2><p><code>public double <strong>value</strong>()</code></p><p>Retrieves the duration of time stored as the number of seconds within it</p><h3>Returns</h3><p><code>double</code> - Number of seconds making up this duration of time</p><hr><h2><a name="method_year">year</a></h2><p><code>public int <strong>year</strong>()</code></p><p>Retrieves the number of years within the duration of time stored</p><h3>Returns</h3><p><code>int</code> - Number of years within the duration of time stored</p><hr></body></html>