net.sf.saxon.value

Class GYearMonthValue

public class GYearMonthValue extends GDateValue

Implementation of the xs:gYearMonth data type
Constructor Summary
GYearMonthValue(int year, byte month, int tz)
GYearMonthValue(int year, byte month, int tz, AtomicType type)
Method Summary
CalendarValueadd(DurationValue duration)
Add a duration to this date/time value
CalendarValueadjustTimezone(int tz)
Return a new date, time, or dateTime with the same normalized value, but in a different timezone
ConversionResultconvertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type
AtomicValuecopyAsSubType(AtomicType typeLabel)
Make a copy of this date, time, or dateTime value
CharSequencegetPrimitiveStringValue()
BuiltInAtomicTypegetPrimitiveType()
Determine the primitive type of the value.
static ConversionResultmakeGYearMonthValue(CharSequence value)

Constructor Detail

GYearMonthValue

public GYearMonthValue(int year, byte month, int tz)

GYearMonthValue

public GYearMonthValue(int year, byte month, int tz, AtomicType type)

Method Detail

add

public CalendarValue add(DurationValue duration)
Add a duration to this date/time value

Parameters: duration the duration to be added (which might be negative)

Returns: a new date/time value representing the result of adding the duration. The original object is not modified.

Throws: net.sf.saxon.trans.XPathException

adjustTimezone

public CalendarValue adjustTimezone(int tz)
Return a new date, time, or dateTime with the same normalized value, but in a different timezone

Parameters: tz the new timezone, in minutes

Returns: the date/time in the new timezone

convertPrimitive

public ConversionResult convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type

Parameters: requiredType an integer identifying the required atomic type context

Returns: an AtomicValue, a value of the required type; or an ErrorValue

copyAsSubType

public AtomicValue copyAsSubType(AtomicType typeLabel)
Make a copy of this date, time, or dateTime value

Parameters: typeLabel

getPrimitiveStringValue

public CharSequence getPrimitiveStringValue()

getPrimitiveType

public BuiltInAtomicType getPrimitiveType()
Determine the primitive type of the value. This delivers the same answer as getItemType().getPrimitiveItemType(). The primitive types are the 19 primitive types of XML Schema, plus xs:integer, xs:dayTimeDuration and xs:yearMonthDuration, and xs:untypedAtomic. For external objects, the result is AnyAtomicType.

makeGYearMonthValue

public static ConversionResult makeGYearMonthValue(CharSequence value)