Package org.eclipse.wst.xml.xpath2.processor.internal.types


org.eclipse.wst.xml.xpath2.processor.internal.types
Class XSTime



public class XSTime
extends org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType
A representation of the Time datatype

Constructor Summary

XSTime(java.util.Calendar cal , org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)
XSTime()

Method Summary

public java.util.Calendarcalendar()
     Retrieves a Calendar representation of time stored
public java.lang.Objectclone()
     Creates a new copy of the time (and timezone) stored
public org.eclipse.wst.xml.xpath2.api.ResultSequenceconstructor(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Creates a new ResultSequence consisting of the extractable time from the supplied ResultSequence
public booleaneq(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 XSTime representation
public java.lang.ObjectgetNativeValue()
    
public java.lang.StringgetStringValue()
     Retrieves a String representation of the time stored
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinitiongetTypeDefinition()
    
public booleangt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)
     Comparison between this and the supplied XSTime representation
public inthour()
     Retrieves the hour stored as an integer
public booleanlt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)
     Comparison between this and the supplied XSTime representation
public org.eclipse.wst.xml.xpath2.api.ResultSequenceminus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical subtraction between this time stored and the supplied representation. This supplied representation must be of either type XSTime (in which case the result is the duration of time between these two times) or a XSDayTimeDuration (in which case the result is the time when this duration is subtracted from the time stored).
public intminute()
     Retrieves the minute stored as an integer
public static org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarTypeparse_time(java.lang.String str)
     Creates a new XSTime representing the String represented supplied time
public org.eclipse.wst.xml.xpath2.api.ResultSequenceplus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical addition between this time stored and the supplied time duration.
public doublesecond()
     Retrieves the seconds stored as an integer
public java.lang.Stringstring_type()
     Retrieves the datatype's full pathname
public booleantimezoned()
     Check for whether the time stored has a timezone associated with it
public java.lang.Stringtype_name()
     Retrieves the datatype's name
public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDurationtz()
     Retrieves the timezone associated with the time stored as a duration of time
public doublevalue()
     Retrieves the time in milliseconds since the epoch

Constructor Detail

XSTime

public XSTime(java.util.Calendar cal , org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz)

Initialises to the supplied time and timezone


XSTime

public XSTime()

Initialises to the current time


Methods Detail

calendar

public java.util.Calendar calendar()

Retrieves a Calendar representation of time stored

Returns

java.util.Calendar - Calendar representation of the time stored


clone

public java.lang.Object clone()

Creates a new copy of the time (and timezone) stored

Returns

java.lang.Object - New XSTime representing the copy of the time and timezone

Throws:

java.lang.CloneNotSupportedException


constructor

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 from the supplied ResultSequence

Parameters

arg - The ResultSequence from which to extract the time

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - New ResultSequence consisting of the supplied time

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


eq

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 XSTime representation

Parameters

arg - The XSTime to compare with

dynamicContext

Returns

boolean - True if both XSTime's represent the same time. False otherwise

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


getNativeValue

public java.lang.Object getNativeValue()

Returns

java.lang.Object


getStringValue

public java.lang.String getStringValue()

Retrieves a String representation of the time stored

Returns

java.lang.String - String representation of the time stored


getTypeDefinition

public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition getTypeDefinition()

Returns

org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition


gt

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 XSTime representation

Parameters

arg - The XSTime to compare with

context

Returns

boolean - True if the supplied time represnts a point in time before that represented by the time stored. False otherwise

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


hour

public int hour()

Retrieves the hour stored as an integer

Returns

int - The hour stored


lt

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 XSTime representation

Parameters

arg - The XSTime to compare with

context

Returns

boolean - True if the supplied time represnts a point in time after that represented by the time stored. False otherwise

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


minus

public org.eclipse.wst.xml.xpath2.api.ResultSequence minus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical subtraction between this time stored and the supplied representation. This supplied representation must be of either type XSTime (in which case the result is the duration of time between these two times) or a XSDayTimeDuration (in which case the result is the time when this duration is subtracted from the time stored).

Parameters

arg - The representation to subtract (either XSTim or XDTDayTimeDuration)

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - A ResultSequence representing the result of the subtraction

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


minute

public int minute()

Retrieves the minute stored as an integer

Returns

int - The minute stored


parse_time

public org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType parse_time(java.lang.String str)

Creates a new XSTime representing the String represented supplied time

Parameters

str - String represented time and timezone to be stored

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType - New XSTime representing the supplied time


plus

public org.eclipse.wst.xml.xpath2.api.ResultSequence plus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical addition between this time stored and the supplied time duration.

Parameters

arg - A XDTDayTimeDuration representation of the duration of time to add

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - A XSTime representing the result of this addition.

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


second

public double second()

Retrieves the seconds stored as an integer

Returns

double - The second stored


string_type

public java.lang.String string_type()

Retrieves the datatype's full pathname

Returns

java.lang.String - "xs:time" which is the datatype's full pathname


timezoned

public boolean timezoned()

Check for whether the time stored has a timezone associated with it

Returns

boolean - True if the time has a timezone associated. False otherwise


type_name

public java.lang.String type_name()

Retrieves the datatype's name

Returns

java.lang.String - "time" which is the datatype's name


tz

public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz()

Retrieves the timezone associated with the time stored as a duration of time

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration - The duration of time between the time stored and the actual time after the timezone is taken into account


value

public double value()

Retrieves the time in milliseconds since the epoch

Returns

double - time stored in milliseconds since the epoch