|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.value.Value net.sf.saxon.value.AtomicValue net.sf.saxon.value.CalendarValue net.sf.saxon.value.GDateValue
public abstract class GDateValue
Abstract superclass for the primitive types containing date components: xs:date, xs:gYear, xs:gYearMonth, xs:gMonth, xs:gMonthDay, xs:gDay
Field Summary |
---|
Fields inherited from class net.sf.saxon.value.CalendarValue |
---|
NO_TIMEZONE |
Fields inherited from class net.sf.saxon.value.Value |
---|
EMPTY_CLASS_ARRAY, INDETERMINATE_ORDERING |
Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
---|
EMPTY_VALUE_ARRAY |
Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
---|
EMPTY_VALUE_ARRAY |
Constructor Summary | |
---|---|
GDateValue()
|
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. |
Object |
convertToJava(Class target,
XPathContext context)
Convert to Java object (for passing to external functions) |
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. |
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 |
DateTimeValue |
toDateTime()
Convert to DateTime. |
Methods inherited from class net.sf.saxon.value.CalendarValue |
---|
add, adjustTimezone, adjustTimezone, appendTimezone, appendTimezone, getStringValue, getTimezoneInMinutes, getXPathComparable, hasTimezone, removeTimezone, setTimezoneInMinutes, subtract |
Methods inherited from class net.sf.saxon.value.AtomicValue |
---|
asAtomic, checkPermittedContents, convert, convert, copyAsSubType, effectiveBooleanValue, getCardinality, getComponent, getItemType, getLength, getPrimitiveType, getStringValueCS, getTypedValue, getTypeLabel, isNaN, itemAt, iterate, process, setTypeLabel, subsequence, toString |
Methods inherited from class net.sf.saxon.value.Value |
---|
asItem, asItem, asIterator, asValue, convertJavaObjectToXPath, convertToJava, fromItem, getCanonicalLexicalRepresentation, getIterator, iterate, makeQNameValue, reduce, stringToNumber |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GDateValue()
Method Detail |
---|
public int getYear()
public byte getMonth()
public byte getDay()
public GregorianCalendar getCalendar()
CalendarValue
getCalendar
in class CalendarValue
public Object convertToJava(Class target, XPathContext context) throws XPathException
convertToJava
in class Value
target
- the required target classcontext
- the XPath dynamic evaluation context
XPathException
public static boolean isValidDate(int year, int month, int day)
year
- the yearmonth
- the month (1-12)day
- the day (1-31)
public static boolean isLeapYear(int year)
year
- the year
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 AtomicValue
o
- the other value
ClassCastException
- if the values are not comparablepublic int hashCode()
hashCode
in class Object
public int compareTo(CalendarValue other, XPathContext context) throws NoDynamicContextException
compareTo
in class CalendarValue
other
- 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 CalendarValue
public Comparable getSchemaComparable()
AtomicValue
In the case of data types that are partially ordered, the returned Comparable extends the standard
semantics of the compareTo() method by returning the value Value.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 class AtomicValue
public ComparisonKey getComparisonKey(XPathContext context) throws NoDynamicContextException
getComparisonKey
in class CalendarValue
context
- XPath dynamic evaluation context
NoDynamicContextException
- if the implicit timezone is required and is not available
(because the method is being called at compile time)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |