Package org.eclipse.wst.xml.xpath2.processor.internal.types
public class XSDuration extends org.eclipse.wst.xml.xpath2.processor.internal.types.CtrTypeA representation of the xs:duration data type. Other duration implementations should inherit from this implementation.
Field Summary | |
protected int | _days |
protected int | _hours |
protected int | _minutes |
protected int | _month |
protected boolean | _negative |
protected double | _seconds |
protected int | _year |
Constructor Summary |
XSDuration(int years
,
int months
,
int days
,
int hours
,
int minutes
,
double seconds
,
boolean negative) |
XSDuration(double secs) |
XSDuration() |
Method Summary | |
public java.lang.Object | clone() |
public org.eclipse.wst.xml.xpath2.api.ResultSequence | constructor(org.eclipse.wst.xml.xpath2.api.ResultSequence arg) Creates a new ResultSequence consisting of the extractable time duration from the supplied ResultSequence |
public int | days() Retrieves the number of days within the duration of time stored |
public boolean | eq(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext) Equality comparison between this and the supplied duration of time. |
public java.lang.Object | getNativeValue() |
public java.lang.String | getStringValue() Retrieves a String representation of the duration stored |
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition | getTypeDefinition() |
public boolean | gt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.api.DynamicContext context) Comparison between this and the supplied duration of time. |
public int | hours() Retrieves the number of hours (max 24) within the duration of time stored |
protected boolean | isCastable(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat) |
public boolean | lt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.api.DynamicContext context) Comparison between this and the supplied duration of time. |
public int | minutes() Retrieves the number of minutes (max 60) within the duration of time stored |
public int | month() Retrieves the number of months within the duration of time stored |
public boolean | negative() Retrieves whether this duration represents a backward passage through time |
public static org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration | parseDTDuration(java.lang.String str) Creates a new XSDayTimeDuration by parsing the supplied String represented duration of time |
public double | seconds() Retrieves the number of seconds (max 60) within the duration of time stored |
public java.lang.String | string_type() |
public double | time_value() |
public java.lang.String | type_name() |
public double | value() Retrieves the duration of time stored as the number of seconds within it |
public int | year() Retrieves the number of years within the duration of time stored |
Field Detail |
protected int _days
protected int _hours
protected int _minutes
protected int _month
protected boolean _negative
protected double _seconds
protected int _year
Constructor Detail |
public XSDuration(int years
,
int months
,
int days
,
int hours
,
int minutes
,
double seconds
,
boolean negative)
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
public XSDuration(double secs)
Initialises to the given number of seconds
public XSDuration()
Initialises to a duration of no time (0days, 0hours, 0minutes, 0seconds)
Methods Detail |
public java.lang.Object clone()
java.lang.Object
java.lang.CloneNotSupportedException
public org.eclipse.wst.xml.xpath2.api.ResultSequence constructor(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
Creates a new ResultSequence consisting of the extractable time duration from the supplied ResultSequence
arg
- The ResultSequence from which to extract
org.eclipse.wst.xml.xpath2.api.ResultSequence
- New ResultSequence consisting of the time duration extracted
org.eclipse.wst.xml.xpath2.processor.DynamicError
public int days()
Retrieves the number of days within the duration of time stored
int
- Number of days within the duration of time stored
public boolean eq(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)
Equality comparison between this and the supplied duration of time.
arg
- The duration of time to compare with
dynamicContext
boolean
- True if they both represent the duration of time. False otherwise
org.eclipse.wst.xml.xpath2.processor.DynamicError
public java.lang.Object getNativeValue()
java.lang.Object
public java.lang.String getStringValue()
Retrieves a String representation of the duration stored
java.lang.String
- String representation of the duration stored
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition getTypeDefinition()
org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition
public boolean gt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.api.DynamicContext context)
Comparison between this and the supplied duration of time.
arg
- The duration of time to compare with
context
boolean
- True if the supplied time represents a smaller duration than that stored. False otherwise
org.eclipse.wst.xml.xpath2.processor.DynamicError
public int hours()
Retrieves the number of hours (max 24) within the duration of time stored
int
- Number of hours within the duration of time stored
protected boolean isCastable(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat)
aat
boolean
public boolean lt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg
,
org.eclipse.wst.xml.xpath2.api.DynamicContext context)
Comparison between this and the supplied duration of time.
arg
- The duration of time to compare with
context
boolean
- True if the supplied time represents a larger duration than that stored. False otherwise
org.eclipse.wst.xml.xpath2.processor.DynamicError
public int minutes()
Retrieves the number of minutes (max 60) within the duration of time stored
int
- Number of minutes within the duration of time stored
public int month()
Retrieves the number of months within the duration of time stored
int
- Number of months within the duration of time stored
public boolean negative()
Retrieves whether this duration represents a backward passage through time
boolean
- True if this duration represents a backward passage through time. False otherwise
public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration parseDTDuration(java.lang.String str)
Creates a new XSDayTimeDuration by parsing the supplied String represented duration of time
str
- String represented duration of time
org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration
- New XSDayTimeDuration representing the duration of time supplied
public double seconds()
Retrieves the number of seconds (max 60) within the duration of time stored
double
- Number of seconds within the duration of time stored
public java.lang.String string_type()
java.lang.String
public double time_value()
double
public java.lang.String type_name()
java.lang.String
public double value()
Retrieves the duration of time stored as the number of seconds within it
double
- Number of seconds making up this duration of time
public int year()
Retrieves the number of years within the duration of time stored
int
- Number of years within the duration of time stored