org.ucl.xpath.types
Class XSGYearMonth

java.lang.Object
  extended byorg.ucl.xpath.types.AnyType
      extended byorg.ucl.xpath.types.AnySimpleType
          extended byorg.ucl.xpath.types.AnyAtomicType
              extended byorg.ucl.xpath.types.CtrType
                  extended byorg.ucl.xpath.types.CalendarType
                      extended byorg.ucl.xpath.types.XSGYearMonth
All Implemented Interfaces:
CmpEq

public class XSGYearMonth
extends CalendarType
implements CmpEq

A representation of the YearMonth datatype


Constructor Summary
XSGYearMonth()
          Initialises a representation of the current year and month
XSGYearMonth(java.util.Calendar cal, boolean tz)
          Initialises a representation of the supplied year and month
 
Method Summary
 java.util.Calendar calendar()
          Retrieves the Calendar representation of the year and month stored
 ResultSequence constructor(ResultSequence arg)
          Creates a new ResultSequence consisting of the extractable gYearMonth in the supplied ResultSequence
 boolean eq(AnyType arg)
          Equality comparison between this and the supplied representation.
 int month()
          Retrieves the actual month as an integer
static XSGYearMonth parse_gYearMonth(java.lang.String str)
          Parses a String representation of a year and month and constructs a new XSGYearMonth representation of it.
 java.lang.String string_type()
          Retrieves the datatype's full pathname
 java.lang.String string_value()
          Retrieves a String representation of the stored year and month
 boolean timezoned()
          Check for whether a timezone was specified at creation
 java.lang.String type_name()
          Retrieves the datatype's name
 int year()
          Retrieves the actual year as an integer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSGYearMonth

public XSGYearMonth(java.util.Calendar cal,
                    boolean tz)
Initialises a representation of the supplied year and month

Parameters:
cal - Calendar representation of the year and month to be stored
tz - Timezone associated with this year and month

XSGYearMonth

public XSGYearMonth()
Initialises a representation of the current year and month

Method Detail

type_name

public java.lang.String type_name()
Retrieves the datatype's name

Specified by:
type_name in class CtrType
Returns:
"gYearMonth" which is the datatype's name

parse_gYearMonth

public static XSGYearMonth parse_gYearMonth(java.lang.String str)
Parses a String representation of a year and month and constructs a new XSGYearMonth representation of it.

Parameters:
str - The String representation of the year and month (and optional timezone)
Returns:
The XSGYearMonth representation of the supplied date

constructor

public ResultSequence constructor(ResultSequence arg)
                           throws DynamicError
Creates a new ResultSequence consisting of the extractable gYearMonth in the supplied ResultSequence

Specified by:
constructor in class CtrType
Parameters:
arg - The ResultSequence from which the gYearMonth is to be extracted
Returns:
New ResultSequence consisting of the supplied year and month
Throws:
DynamicError

year

public int year()
Retrieves the actual year as an integer

Returns:
The actual year as an integer

month

public int month()
Retrieves the actual month as an integer

Returns:
The actual month as an integer

timezoned

public boolean timezoned()
Check for whether a timezone was specified at creation

Returns:
True if a timezone was specified. False otherwise

string_value

public java.lang.String string_value()
Retrieves a String representation of the stored year and month

Specified by:
string_value in class AnyType
Returns:
String representation of the stored year and month

string_type

public java.lang.String string_type()
Retrieves the datatype's full pathname

Specified by:
string_type in class AnyType
Returns:
"xs:gYearMonth" which is the datatype's full pathname

calendar

public java.util.Calendar calendar()
Retrieves the Calendar representation of the year and month stored

Returns:
Calendar representation of the year and month stored

eq

public boolean eq(AnyType arg)
           throws DynamicError
Equality comparison between this and the supplied representation. This representation must be of type XSGYearMonth

Specified by:
eq in interface CmpEq
Parameters:
arg - The XSGYearMonth to compare with
Returns:
True if the two representations are of the same year and month. False otherwise
Throws:
DynamicError