org.ucl.xpath.types
Class XSGYear

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.XSGYear
All Implemented Interfaces:
CmpEq

public class XSGYear
extends CalendarType
implements CmpEq

A representation of the gMonth datatype


Constructor Summary
XSGYear()
          Initialises a representation of the current year
XSGYear(java.util.Calendar cal, boolean tz)
          Initialises a representation of the supplied month
 
Method Summary
 java.util.Calendar calendar()
          Retrieves the Calendar representation of the year stored
 ResultSequence constructor(ResultSequence arg)
          Creates a new ResultSequence consisting of the extractable gYear in the supplied ResultSequence
 boolean eq(AnyType arg)
          Equality comparison between this and the supplied representation.
static XSGYear parse_gYear(java.lang.String str)
          Parses a String representation of a year and constructs a new XSGYear 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
 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

XSGYear

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

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

XSGYear

public XSGYear()
Initialises a representation of the current year

Method Detail

type_name

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

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

parse_gYear

public static XSGYear parse_gYear(java.lang.String str)
Parses a String representation of a year and constructs a new XSGYear representation of it.

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

constructor

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

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

year

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

Returns:
The actual year 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

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

string_type

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

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

calendar

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

Returns:
Calendar representation of the year stored

eq

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

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