|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.value.Value
net.sf.saxon.value.AtomicValue
net.sf.saxon.value.CalendarValue
public abstract class CalendarValue
Abstract superclass for Date, Time, and DateTime.
Field Summary | |
---|---|
static int |
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 |
Constructor Summary | |
---|---|
CalendarValue()
|
Method Summary | |
---|---|
abstract CalendarValue |
add(DurationValue duration)
Add a duration to this date/time value |
CalendarValue |
adjustTimezone(DayTimeDurationValue tz)
Return a new date, time, or dateTime with the same normalized value, but in a different timezone, specified as a dayTimeDuration |
abstract CalendarValue |
adjustTimezone(int tz)
Return a new date, time, or dateTime with the same normalized value, but in a different timezone |
void |
appendTimezone(FastStringBuffer sb)
Add a string representation of the timezone, typically formatted as "Z" or "+03:00" or "-10:00", to a supplied string buffer |
static void |
appendTimezone(int tz,
FastStringBuffer sb)
|
abstract int |
compareTo(CalendarValue other,
Configuration config)
Compare this value to another value of the same type, using the supplied ConversionContext to get the implicit timezone if required. |
abstract GregorianCalendar |
getCalendar()
Get a Java Calendar object that represents this date/time value. |
abstract ComparisonKey |
getComparisonKey(Configuration config)
Get a comparison key for this value. |
String |
getStringValue()
Convert the value to a string |
int |
getTimezoneInMinutes()
Get the timezone value held in this object. |
boolean |
hasTimezone()
Determine whether this value includes a timezone |
CalendarValue |
removeTimezone()
Return a date, time, or dateTime with the same localized value, but without the timezone component |
void |
setTimezoneInMinutes(int minutes)
Modify the timezone value held in this object. |
DayTimeDurationValue |
subtract(CalendarValue other,
XPathContext context)
Determine the difference between two points in time, as a duration |
abstract DateTimeValue |
toDateTime()
Convert the value to a DateTime, retaining all the components that are actually present, and substituting conventional values for components that are missing |
Methods inherited from class net.sf.saxon.value.AtomicValue |
---|
checkPermittedContents, convert, convert, convertPrimitive, copy, effectiveBooleanValue, getCardinality, getComponent, getItemType, getLength, getPrimitiveType, getStringValueCS, getTypedValue, getTypeLabel, getXPathComparable, hasBuiltInType, isMultiValued, itemAt, iterate, process, setTypeLabel, toString |
Methods inherited from class net.sf.saxon.value.Value |
---|
asItem, asItem, asIterator, asValue, compareTo, convert, convertJavaObjectToXPath, convertToJava, equals, fromItem, getCanonicalLexicalRepresentation, getIterator, getSchemaComparable, hashCode, iterate, makeQNameValue, reduce, stringToNumber |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
public static final int NO_TIMEZONE
Constructor Detail |
---|
public CalendarValue()
Method Detail |
---|
public final boolean hasTimezone()
public final void setTimezoneInMinutes(int minutes)
minutes
- The timezone offset from GMT in minutes, positive or negative; or the special
value NO_TIMEZONE indicating that the value is not in a timezone (this is the default if this
method is not called)public abstract DateTimeValue toDateTime()
public final int getTimezoneInMinutes()
public final String getStringValue()
getStringValue
in interface Item
getStringValue
in interface ValueRepresentation
getStringValue
in class AtomicValue
Item.getStringValueCS()
public abstract GregorianCalendar getCalendar()
public abstract CalendarValue add(DurationValue duration) throws XPathException
duration
- the duration to be added (which might be negative)
XPathException
public DayTimeDurationValue subtract(CalendarValue other, XPathContext context) throws XPathException
other
- the other point in timecontext
- the dynamic context, used to obtain timezone information. May be set to null
only if both values contain an explicit timezone, or if neither does so.
XPathException
- for example if one value is a date and the other is a timepublic final CalendarValue removeTimezone()
public abstract CalendarValue adjustTimezone(int tz)
tz
- the new timezone, in minutes
public final CalendarValue adjustTimezone(DayTimeDurationValue tz) throws XPathException
tz
- the new timezone, in minutes
XPathException
public abstract int compareTo(CalendarValue other, Configuration config)
public abstract ComparisonKey getComparisonKey(Configuration config)
public final void appendTimezone(FastStringBuffer sb)
sb
- The StringBuffer that will be updated with the resulting string
representationpublic static final void appendTimezone(int tz, FastStringBuffer sb)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |