net.sf.saxon.value
public abstract class GDateValue extends CalendarValue
Field Summary | |
---|---|
protected byte | day |
protected static byte[] | daysPerMonth
Test whether a candidate date is actually a valid date in the proleptic Gregorian calendar |
protected byte | month |
protected static short[] | monthData |
protected int | year |
Method Summary | |
---|---|
int | compareTo(CalendarValue other, XPathContext context)
Compare this value to another value of the same type, using the supplied context object
to get the implicit timezone if required. |
boolean | equals(Object o)
The equals() methods on atomic values is defined to follow the semantics of eq when applied
to two atomic values. |
GregorianCalendar | getCalendar() |
ComparisonKey | getComparisonKey(XPathContext context)
Get a comparison key for this value. |
AtomicValue | getComponent(int component)
Get a component of the value. |
byte | getDay()
Get the day component of the date (in local form) |
byte | getMonth()
Get the month component of the date (in local form) |
Comparable | getSchemaComparable() |
int | getYear()
Get the year component of the date (in local form) |
int | hashCode() |
static boolean | isLeapYear(int year)
Test whether a year is a leap year |
static boolean | isValidDate(int year, int month, int day)
Determine whether a given date is valid |
protected static ConversionResult | setLexicalValue(GDateValue d, CharSequence s)
Initialize the DateValue using a character string in the format yyyy-mm-dd and an optional time zone.
|
DateTimeValue | toDateTime()
Convert to DateTime. |
Parameters: other the value to be compared context the XPath dynamic evaluation context (needed only to get the implicit timezone)
Returns: -1 if this value is less, 0 if equal, +1 if greater
The hashCode() method is consistent with equals().
This implementation performs a context-free comparison: it fails with ClassCastException if one value has a timezone and the other does not.
Parameters: o the other value
Returns: true if the other operand is an atomic value and the two values are equal as defined by the XPath eq operator
Throws: ClassCastException if the values are not comparable
Parameters: context XPath dynamic evaluation context
Throws: NoDynamicContextException if the implicit timezone is required and is not available (because the method is being called at compile time)
Returns: the day component (1-31)
Returns: the month component (1-12)
Returns: the year component
Parameters: year the year
Returns: true if the supplied year is a leap year
Parameters: year the year month the month (1-12) day the day (1-31)
Returns: true if this is a valid date
Parameters: d the "raw" DateValue to be populated s the supplied string value
Returns: either the supplied GDateValue, with its data initialized; or a ValidationFailure
Returns: the starting instant of the GDateValue (with the same timezone)