public class GYearValue extends GDateValue
day, daysPerMonth, month, monthData, xsd10rules, year
NO_TIMEZONE
typeLabel
INDETERMINATE_ORDERING
EMPTY_VALUE_ARRAY
Constructor and Description |
---|
GYearValue(int year,
int tz,
AtomicType type) |
GYearValue(int year,
int tz,
boolean xsd10) |
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,
ConversionRules rules)
Convert to target data type
|
AtomicValue |
copyAsSubType(AtomicType typeLabel)
Make a copy of this date, time, or dateTime value
|
CharSequence |
getPrimitiveStringValue()
Convert the value to a string, using the serialization rules for the primitive type.
|
BuiltInAtomicType |
getPrimitiveType()
Determine the primitive type of the value.
|
static ConversionResult |
makeGYearValue(CharSequence value,
ConversionRules rules) |
compareTo, equals, getCalendar, getComparisonKey, getComponent, getDay, getMonth, getSchemaComparable, getYear, hashCode, isLeapYear, isValidDate, setLexicalValue, toDateTime
adjustTimezone, appendString, appendTimezone, appendTimezone, appendTwoDigits, getTimezoneInMinutes, getXPathComparable, hasTimezone, isIdentical, makeCalendarValue, removeTimezone, setTimezoneInMinutes, subtract
asAtomic, checkPermittedContents, convert, convert, convert, effectiveBooleanValue, getCardinality, getItemType, getLength, getStringValue, getStringValueCS, getTypedValue, getTypeLabel, isNaN, itemAt, iterate, process, setTypeLabel, subsequence, toString
asItem, asItem, asIterator, asValue, convertToJava, fromItem, getCanonicalLexicalRepresentation, getIterator, iterate, reduce
public GYearValue(int year, int tz, boolean xsd10)
public GYearValue(int year, int tz, AtomicType type)
public static ConversionResult makeGYearValue(CharSequence value, ConversionRules rules)
public AtomicValue copyAsSubType(AtomicType typeLabel)
copyAsSubType
in class AtomicValue
typeLabel
- public BuiltInAtomicType getPrimitiveType()
getPrimitiveType
in class AtomicValue
public ConversionResult convertPrimitive(BuiltInAtomicType requiredType, boolean validate, ConversionRules rules)
convertPrimitive
in class AtomicValue
requiredType
- an integer identifying the required atomic typerules
- 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 CharSequence getPrimitiveStringValue()
AtomicValue
getPrimitiveStringValue
in class AtomicValue
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