Package net.sf.saxon.value
Class GYearMonthValue
- java.lang.Object
-
- net.sf.saxon.value.AtomicValue
-
- net.sf.saxon.value.CalendarValue
-
- net.sf.saxon.value.GDateValue
-
- net.sf.saxon.value.GYearMonthValue
-
- All Implemented Interfaces:
java.lang.Iterable<AtomicValue>,AtomicMatchKey,AtomicSequence,GroundedValue,IdentityComparable,Item,Sequence,ConversionResult
public class GYearMonthValue extends GDateValue
Implementation of the xs:gYearMonth data type
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.value.GDateValue
day, daysPerMonth, hasNoYearZero, month, monthData, year
-
Fields inherited from class net.sf.saxon.value.CalendarValue
MISSING_TIMEZONE, NO_TIMEZONE
-
Fields inherited from class net.sf.saxon.value.AtomicValue
typeLabel
-
Fields inherited from interface net.sf.saxon.expr.sort.AtomicMatchKey
NaN_MATCH_KEY
-
-
Constructor Summary
Constructors Constructor Description GYearMonthValue(int year, byte month, int tz, boolean xsd10)GYearMonthValue(int year, byte month, int tz, AtomicType type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CalendarValueadd(DurationValue duration)Add a duration to this date/time valueCalendarValueadjustTimezone(int tz)Return a new date, time, or dateTime with the same normalized value, but in a different timezoneAtomicValuecopyAsSubType(AtomicType typeLabel)Make a copy of this date, time, or dateTime valuejava.lang.CharSequencegetPrimitiveStringValue()Convert the value to a string, using the serialization rules for the primitive type.BuiltInAtomicTypegetPrimitiveType()Determine the primitive type of the value.static ConversionResultmakeGYearMonthValue(java.lang.CharSequence value, ConversionRules rules)-
Methods inherited from class net.sf.saxon.value.GDateValue
checkValidInJavascript, compareTo, equals, getCalendar, getComponent, getDay, getMonth, getSchemaComparable, getYear, hashCode, isLeapYear, isValidDate, setLexicalValue, toDateTime
-
Methods inherited from class net.sf.saxon.value.CalendarValue
adjustTimezone, appendTimezone, appendTimezone, asMapKey, getComparisonKey, getTimezoneInMinutes, getXMLGregorianCalendar, getXPathComparable, hasTimezone, identityHashCode, isIdentical, makeCalendarValue, removeTimezone, setTimezoneInMinutes, subtract
-
Methods inherited from class net.sf.saxon.value.AtomicValue
asAtomic, atomize, checkPermittedContents, effectiveBooleanValue, getCanonicalLexicalRepresentation, getCardinality, getGenre, getItemType, getLength, getStringValue, getStringValueCS, getUType, head, isIdentical, isNaN, itemAt, iterate, iterator, setTypeLabel, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.expr.sort.AtomicMatchKey
asAtomic
-
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
isStreamed, reduce, subsequence, toShortString
-
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
-
-
-
Constructor Detail
-
GYearMonthValue
public GYearMonthValue(int year, byte month, int tz, boolean xsd10)
-
GYearMonthValue
public GYearMonthValue(int year, byte month, int tz, AtomicType type)
-
-
Method Detail
-
makeGYearMonthValue
public static ConversionResult makeGYearMonthValue(java.lang.CharSequence value, ConversionRules rules)
-
copyAsSubType
public AtomicValue copyAsSubType(AtomicType typeLabel)
Make a copy of this date, time, or dateTime value- Specified by:
copyAsSubTypein classAtomicValue- Parameters:
typeLabel-- Returns:
- the copied value
-
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.- Specified by:
getPrimitiveTypein classAtomicValue- Returns:
- the primitive type
-
getPrimitiveStringValue
public java.lang.CharSequence getPrimitiveStringValue()
Description copied from class:AtomicValueConvert the value to a string, using the serialization rules for the primitive type. This is the result of conversion to a string except that postprocessing defined by the saxon:preprocess facet is not (yet) applied.- Specified by:
getPrimitiveStringValuein classAtomicValue- Returns:
- the value converted to a string according to the rules for the primitive type
-
add
public CalendarValue add(DurationValue duration) throws XPathException
Add a duration to this date/time value- Specified by:
addin classCalendarValue- 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:
XPathException
-
adjustTimezone
public CalendarValue adjustTimezone(int tz)
Return a new date, time, or dateTime with the same normalized value, but in a different timezone- Specified by:
adjustTimezonein classCalendarValue- Parameters:
tz- the new timezone, in minutes- Returns:
- the date/time in the new timezone
-
-