net.sf.saxon.value
public class GYearValue extends GDateValue
day, daysPerMonth, month, monthData, year
NO_TIMEZONE
typeLabel
EMPTY_CLASS_ARRAY, INDETERMINATE_ORDERING
EMPTY_VALUE_ARRAY
Constructor and Description |
---|
GYearValue(int year,
int tz) |
GYearValue(int year,
int tz,
AtomicType type) |
Modifier and Type | Method and Description |
---|---|
CalendarValue |
add(DurationValue duration)
Add a duration to this date/time value
|
CalendarValue |
adjustTimezone(int tz)
Return a new date, time, or dateTime with the same normalized value, but
in a different timezone
|
ConversionResult |
convertPrimitive(BuiltInAtomicType requiredType,
boolean validate,
XPathContext context)
Convert to target data type
|
AtomicValue |
copyAsSubType(AtomicType typeLabel)
Make a copy of this date, time, or dateTime value
|
BuiltInAtomicType |
getPrimitiveType()
Determine the primitive type of the value.
|
java.lang.CharSequence |
getStringValueCS()
Get the value of the item as a CharSequence.
|
static ConversionResult |
makeGYearValue(java.lang.CharSequence value) |
compareTo, equals, getCalendar, getComparisonKey, getComponent, getDay, getMonth, getSchemaComparable, getYear, hashCode, isLeapYear, isValidDate, setLexicalValue, toDateTime
adjustTimezone, appendTimezone, appendTimezone, getStringValue, getTimezoneInMinutes, getXPathComparable, hasTimezone, removeTimezone, setTimezoneInMinutes, subtract
asAtomic, checkPermittedContents, convert, convert, effectiveBooleanValue, getCardinality, getItemType, getLength, getTypedValue, getTypeLabel, isNaN, itemAt, iterate, process, setTypeLabel, subsequence, toString
asItem, asItem, asIterator, asValue, convertToJava, fromItem, getCanonicalLexicalRepresentation, getIterator, iterate, makeQNameValue, reduce, stringToNumber
public GYearValue(int year, int tz)
public GYearValue(int year, int tz, AtomicType type)
public static ConversionResult makeGYearValue(java.lang.CharSequence value)
public AtomicValue copyAsSubType(AtomicType typeLabel)
copyAsSubType
in class AtomicValue
typeLabel
- public BuiltInAtomicType getPrimitiveType()
getPrimitiveType
in class AtomicValue
public ConversionResult convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
convertPrimitive
in class AtomicValue
requiredType
- an integer identifying the required atomic typecontext
- validate
- true if validation is required. If set to false, the caller guarantees that
the value is valid for the target data type, and that further validation
is therefore not required.
Note that a validation failure may be reported even if validation was not requested.public java.lang.CharSequence getStringValueCS()
AtomicValue
getStringValueCS
in interface Item
getStringValueCS
in interface ValueRepresentation
getStringValueCS
in class AtomicValue
Item.getStringValue()
public CalendarValue add(DurationValue duration) throws XPathException
add
in class CalendarValue
duration
- the duration to be added (which might be negative)XPathException
public CalendarValue adjustTimezone(int tz)
adjustTimezone
in class CalendarValue
tz
- the new timezone, in minutes