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


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



public class XSDate
extends org.eclipse.wst.xml.xpath2.processor.internal.types.CalendarType
Representation of a date of the form year-month-day and optional timezone

Constructor Summary

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

Method Summary

public java.util.Calendarcalendar()
     Retrieves the Calendar representation of the date stored
public java.lang.Objectclone()
     Creates a copy of this date representation
public org.eclipse.wst.xml.xpath2.api.ResultSequenceconstructor(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Creates a new result sequence consisting of the retrievable date value in the supplied result sequence
public intday()
     Retrieve the day from the date stored
public booleaneq(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)
     Equality comparison on this and the supplied dates (taking timezones into account)
public java.lang.StringgetStringValue()
     Retrieves a String representation of the date 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 on this and the supplied dates (taking timezones into account)
public booleanlt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)
     Comparison on this and the supplied dates (taking timezones into account)
public org.eclipse.wst.xml.xpath2.api.ResultSequenceminus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical minus operator between this XSDate and a supplied result sequence (XSDate, XSYearMonthDuration and XSDayTimeDuration are only valid ones).
public intmonth()
     Retrieve the month from the date stored
public static org.eclipse.wst.xml.xpath2.processor.internal.types.XSDateparse_date(java.lang.String str)
     Parses a String representation of a date (of the form year-month-day or year-month-day+timezone) and constructs a new XSDate representation of it.
public org.eclipse.wst.xml.xpath2.api.ResultSequenceplus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical addition operator between this XSDate and a supplied result sequence (XDTYearMonthDuration and XDTDayTimeDuration are only valid ones).
public java.lang.Stringstring_type()
     Retrive the datatype full pathname
public booleantimezoned()
     Retrieves whether this date has an optional timezone associated with it
public java.lang.Stringtype_name()
     Retrieves the datatype name
public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDurationtz()
     Retrieves the timezone associated with the date stored
public doublevalue()
     Currently unsupported method. Retrieves the date in milliseconds since the begining of epoch
public intyear()
     Retrieve the year from the date stored

Constructor Detail

XSDate

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

Initializes a new representation of a supplied date


XSDate

public XSDate()

Initializes a new representation of the current date


Methods Detail

calendar

public java.util.Calendar calendar()

Retrieves the Calendar representation of the date stored

Returns

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


clone

public java.lang.Object clone()

Creates a copy of this date representation

Returns

java.lang.Object - A copy of this date representation

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 result sequence consisting of the retrievable date value in the supplied result sequence

Parameters

arg - The result sequence from which to extract the date value.

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - A new result sequence consisting of the date value supplied.

Throws:

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


day

public int day()

Retrieve the day from the date stored

Returns

int - the day value of the date stored


eq

public boolean eq(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)

Equality comparison on this and the supplied dates (taking timezones into account)

Parameters

arg - XSDate representation of the date to compare to

dynamicContext

Returns

boolean - True if the two dates are represent the same exact point in time. False otherwise.

Throws:

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


getStringValue

public java.lang.String getStringValue()

Retrieves a String representation of the date stored

Returns

java.lang.String - String representation of the date 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 on this and the supplied dates (taking timezones into account)

Parameters

arg - XSDate representation of the date to compare to

context

Returns

boolean - True if in time, this date lies after the date supplied. False otherwise.

Throws:

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


lt

public boolean lt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)

Comparison on this and the supplied dates (taking timezones into account)

Parameters

arg - XSDate representation of the date to compare to

context

Returns

boolean - True if in time, this date lies before the date supplied. 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 minus operator between this XSDate and a supplied result sequence (XSDate, XSYearMonthDuration and XSDayTimeDuration are only valid ones).

Parameters

arg - The supplied ResultSequence that is on the right of the minus operator. If this is an XSDate, the result will be a XSDayTimeDuration of the duration of time between these two dates. If arg is an XSYearMonthDuration or an XSDayTimeDuration the result will be a XSDate of the result of the current date minus the duration of time supplied.

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - New ResultSequence consisting of the result of the mathematical minus operation.

Throws:

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


month

public int month()

Retrieve the month from the date stored

Returns

int - the month value of the date stored


parse_date

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

Parses a String representation of a date (of the form year-month-day or year-month-day+timezone) and constructs a new XSDate representation of it.

Parameters

str - The String representation of the date (and optional timezone)

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate - The XSDate representation of the supplied date


plus

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

Mathematical addition operator between this XSDate and a supplied result sequence (XDTYearMonthDuration and XDTDayTimeDuration are only valid ones).

Parameters

arg - The supplied ResultSequence that is on the right of the minus operator. If arg is an XDTYearMonthDuration or an XDTDayTimeDuration the result will be a XSDate of the result of the current date minus the duration of time supplied.

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - New ResultSequence consisting of the result of the mathematical minus operation.

Throws:

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


string_type

public java.lang.String string_type()

Retrive the datatype full pathname

Returns

java.lang.String - "xs:date" which is the datatype full pathname


timezoned

public boolean timezoned()

Retrieves whether this date has an optional timezone associated with it

Returns

boolean - True if there is a timezone associated with this date. False otherwise.


type_name

public java.lang.String type_name()

Retrieves the datatype name

Returns

java.lang.String - "date" which is the dataype name


tz

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

Retrieves the timezone associated with the date stored

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration - the timezone associated with the date stored


value

public double value()

Currently unsupported method. Retrieves the date in milliseconds since the begining of epoch

Returns

double - Number of milliseconds since the begining of the epoch


year

public int year()

Retrieve the year from the date stored

Returns

int - the year value of the date stored