public abstract class GDateValue extends CalendarValue
| Modifier and Type | Field and Description |
|---|---|
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 boolean |
xsd10rules |
protected int |
year |
NO_TIMEZONEtypeLabel| Constructor and Description |
|---|
GDateValue() |
| Modifier and Type | Method and Description |
|---|---|
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()
Get a Java Calendar object that represents this date/time value.
|
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()
Get a Comparable value that implements the XML Schema ordering comparison semantics for this value.
|
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,
ConversionRules rules)
Initialize the DateValue using a character string in the format yyyy-mm-dd and an optional time zone.
|
DateTimeValue |
toDateTime()
Convert to DateTime.
|
add, adjustTimezone, adjustTimezone, appendTimezone, appendTimezone, getTimezoneInMinutes, getXPathComparable, hasTimezone, isIdentical, makeCalendarValue, removeTimezone, setTimezoneInMinutes, subtractasAtomic, checkPermittedContents, copyAsSubType, effectiveBooleanValue, getCanonicalLexicalRepresentation, getCardinality, getItemType, getPrimitiveStringValue, getPrimitiveType, getStringValue, getStringValueCS, head, isIdentical, isNaN, itemAt, iterate, process, setTypeLabel, toStringgetLength, reduce, subsequenceclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetLengthreduce, subsequenceprotected int year
protected byte month
protected byte day
protected boolean xsd10rules
protected static byte[] daysPerMonth
protected static final short[] monthData
public int getYear()
public byte getMonth()
public byte getDay()
public GregorianCalendar getCalendar()
CalendarValuegetCalendar in class CalendarValueprotected static ConversionResult setLexicalValue(GDateValue d, CharSequence s, ConversionRules rules)
d - the "raw" DateValue to be populateds - the supplied string valuerules - public static boolean isValidDate(int year,
int month,
int day)
year - the year (permitting year zero)month - the month (1-12)day - the day (1-31)public static boolean isLeapYear(int year)
year - the year (permitting year zero)public boolean equals(Object o)
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.
equals in class AtomicValueo - the other valueClassCastException - if the values are not comparablepublic int compareTo(CalendarValue other, XPathContext context) throws NoDynamicContextException
compareTo in class CalendarValueother - the value to be comparedcontext - the XPath dynamic evaluation context (needed only to get the implicit timezone)NoDynamicContextException - if the supplied context is an early evaluation context and the
result depends on the implicit timezone, which is not available at compile timepublic DateTimeValue toDateTime()
toDateTime in class CalendarValuepublic Comparable getSchemaComparable()
AtomicValueIn the case of data types that are partially ordered, the returned Comparable extends the standard
semantics of the compareTo() method by returning the value SequenceTool.INDETERMINATE_ORDERING when there
is no defined order relationship between two given values. This value is also returned when two values
of different types are compared.
getSchemaComparable in interface AtomicSequencegetSchemaComparable in class AtomicValuepublic AtomicValue getComponent(int component) throws XPathException
getComponent in class AtomicValuecomponent - identifies the required component, as a constant defined in class
Component, for example Component.HOURSXPathException - if a dynamic error occurspublic ComparisonKey getComparisonKey(XPathContext context) throws NoDynamicContextException
getComparisonKey in class CalendarValuecontext - XPath dynamic evaluation contextNoDynamicContextException - if the implicit timezone is required and is not available
(because the method is being called at compile time)Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.