| java.lang.Object net.sf.saxon.value.Value net.sf.saxon.value.AtomicValue net.sf.saxon.value.CalendarValue net.sf.saxon.value.DateTimeValue
DateTimeValue | final public class DateTimeValue extends CalendarValue (Code) | | A value of type DateTime
|
Method Summary | |
public CalendarValue | add(DurationValue duration) | public CalendarValue | adjustTimezone(int timezone) Return a new dateTime with the same normalized value, but
in a different timezone. | public int | compareTo(Object other) Compare the value to another dateTime value.
This method is not used for XPath comparisons because it does not have access to the implicitTimezone
from the dynamic context. | public int | compareTo(CalendarValue other, XPathContext cc) Compare the value to another dateTime value, following the XPath comparison semantics
Parameters: other - The other dateTime value Parameters: cc - A ConversionContext used to supply the implicit timezone negative value if this one is the earler, 0 if they are chronologically equal,positive value if this one is the later. | public AtomicValue | convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context) | public Object | convertToJava(Class target, XPathContext context) | public CalendarValue | copy() | public boolean | equals(Object other) | public static DateTimeValue | fromJulianInstant(BigDecimal instant) | public GregorianCalendar | getCalendar() Get a Calendar object representing the value of this DateTime. | public AtomicValue | getComponent(int component) Get a component of the value. | public static DateTimeValue | getCurrentDateTime(XPathContext context) Get the dateTime value representing the nominal
date/time of this transformation run. | public byte | getDay() | public byte | getHour() | public ItemType | getItemType(TypeHierarchy th) | public int | getMicrosecond() | public byte | getMinute() | public byte | getMonth() | public byte | getSecond() | public CharSequence | getStringValueCS() Convert to string
ISO 8601 representation. | public int | getYear() | public int | hashCode() | public DateTimeValue | normalize(XPathContext cc) Normalize the date and time to be in timezone Z. | public SecondsDurationValue | subtract(CalendarValue other, XPathContext context) | public DateTimeValue | toDateTime() | public BigDecimal | toJulianInstant() Get the Julian instant: a decimal value whose integer part is the Julian day number
multiplied by the number of seconds per day,
and whose fractional part is the fraction of the second.
This method operates on the local time, ignoring the timezone. |
DateTimeValue | public DateTimeValue(Calendar calendar, boolean tzSpecified)(Code) | | Constructor: create a dateTime value given a Java calendar object
Parameters: calendar - holds the date and time Parameters: tzSpecified - indicates whether the timezone is specified |
DateTimeValue | public DateTimeValue(int year, byte month, byte day, byte hour, byte minute, byte second, int microsecond, int tz)(Code) | | Constructor: construct a DateTimeValue from its components.
This constructor performs no validation.
|
adjustTimezone | public CalendarValue adjustTimezone(int timezone)(Code) | | Return a new dateTime with the same normalized value, but
in a different timezone. This is called only for a DateTimeValue that has an explicit timezone
Parameters: timezone - the new timezone offset, in minutes the date/time in the new timezone. This will be a new DateTimeValue unless no changewas required to the original value |
compareTo | public int compareTo(Object other)(Code) | | Compare the value to another dateTime value.
This method is not used for XPath comparisons because it does not have access to the implicitTimezone
from the dynamic context. It is available for schema comparisons, although it does not currently
implement the XML Schema semantics for timezone comparison (which involve partial ordering)
Parameters: other - The other dateTime value negative value if this one is the earler, 0 if they are chronologically equal,positive value if this one is the later. For this purpose, dateTime values with an unknowntimezone are considered to be values in the implicit timezone (the Comparable interface requiresa total ordering). throws: ClassCastException - if the other value is not a DateTimeValue (the parameteris declared as Object to satisfy the Comparable interface) |
compareTo | public int compareTo(CalendarValue other, XPathContext cc)(Code) | | Compare the value to another dateTime value, following the XPath comparison semantics
Parameters: other - The other dateTime value Parameters: cc - A ConversionContext used to supply the implicit timezone negative value if this one is the earler, 0 if they are chronologically equal,positive value if this one is the later. For this purpose, dateTime values with an unknowntimezone are considered to be values in the implicit timezone (the Comparable interface requiresa total ordering). throws: ClassCastException - if the other value is not a DateTimeValue (the parameteris declared as Object to satisfy the Comparable interface) |
convertPrimitive | public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)(Code) | | Convert to target data type
Parameters: requiredType - an integer identifying the required atomic type Parameters: context - an AtomicValue, a value of the required type; or an ErrorValue |
fromJulianInstant | public static DateTimeValue fromJulianInstant(BigDecimal instant)(Code) | | Get the DateTimeValue corresponding to a given Julian instant
|
getCalendar | public GregorianCalendar getCalendar()(Code) | | Get a Calendar object representing the value of this DateTime. This will respect the timezone
if there is one, or be in GMT otherwise.
|
getComponent | public AtomicValue getComponent(int component) throws XPathException(Code) | | Get a component of the value. Returns null if the timezone component is
requested and is not present.
|
getCurrentDateTime | public static DateTimeValue getCurrentDateTime(XPathContext context)(Code) | | Get the dateTime value representing the nominal
date/time of this transformation run. Two calls within the same
query or transformation will always return the same answer.
|
getDay | public byte getDay()(Code) | | Get the day component
|
getHour | public byte getHour()(Code) | | Get the hour component
|
getItemType | public ItemType getItemType(TypeHierarchy th)(Code) | | Determine the data type of the exprssion
Type.DATE_TIME, Parameters: th - |
getMicrosecond | public int getMicrosecond()(Code) | | Get the year component
|
getMinute | public byte getMinute()(Code) | | Get the minute component
|
getMonth | public byte getMonth()(Code) | | Get the month component
|
getSecond | public byte getSecond()(Code) | | Get the second component
|
getStringValueCS | public CharSequence getStringValueCS()(Code) | | Convert to string
ISO 8601 representation. The value returned is the localized representation,that is it uses the timezone contained within the value itself. |
getYear | public int getYear()(Code) | | Get the year component
|
hashCode | public int hashCode()(Code) | | |
normalize | public DateTimeValue normalize(XPathContext cc)(Code) | | Normalize the date and time to be in timezone Z.
Parameters: cc - used to supply the implicit timezone, used when the value hasno explicit timezone in general, a new DateTimeValue in timezone Z, representing the same instant in time.Returns the original DateTimeValue if this is already in timezone Z. |
toDateTime | public DateTimeValue toDateTime()(Code) | | Convert the value to a DateTime, retaining all the components that are actually present, and
substituting conventional values for components that are missing
|
toJulianInstant | public BigDecimal toJulianInstant()(Code) | | Get the Julian instant: a decimal value whose integer part is the Julian day number
multiplied by the number of seconds per day,
and whose fractional part is the fraction of the second.
This method operates on the local time, ignoring the timezone. The caller should call normalize()
before calling this method to get a normalized time.
|
Fields inherited from net.sf.saxon.value.CalendarValue | final public static int NO_TIMEZONE(Code)(Java Doc)
|
Fields inherited from net.sf.saxon.value.Value | final public static Class[] EMPTY_CLASS_ARRAY(Code)(Java Doc)
|
Methods inherited from net.sf.saxon.value.Value | public static Item asItem(ValueRepresentation value, XPathContext context) throws XPathException(Code)(Java Doc) public static SequenceIterator asIterator(ValueRepresentation val, XPathContext context) throws XPathException(Code)(Java Doc) public static Value asValue(ValueRepresentation val)(Code)(Java Doc) public void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException(Code)(Java Doc) public static CharSequence collapseWhitespace(CharSequence in)(Code)(Java Doc) public static Object convert(Item item) throws XPathException(Code)(Java Doc) public static Value convertJavaObjectToXPath(Object object, SequenceType requiredType, Configuration config) throws XPathException(Code)(Java Doc) public Object convertToJava(Class target, XPathContext context) throws XPathException(Code)(Java Doc) public void display(int level, NamePool pool, PrintStream out)(Code)(Java Doc) public boolean effectiveBooleanValue(XPathContext context) throws XPathException(Code)(Java Doc) public boolean equals(Object obj)(Code)(Java Doc) public String evaluateAsString(XPathContext context) throws XPathException(Code)(Java Doc) public Item evaluateItem(XPathContext context) throws XPathException(Code)(Java Doc) public int getCardinality()(Code)(Java Doc) final public int getDependencies()(Code)(Java Doc) public ItemType getItemType(TypeHierarchy th)(Code)(Java Doc) public static SequenceIterator getIterator(ValueRepresentation val) throws XPathException(Code)(Java Doc) public int getLength() throws XPathException(Code)(Java Doc) final public Container getParentExpression()(Code)(Java Doc) public int getSpecialProperties()(Code)(Java Doc) public String getStringValue() throws XPathException(Code)(Java Doc) public int hashCode()(Code)(Java Doc) public Item itemAt(int n) throws XPathException(Code)(Java Doc) final public Iterator iterateSubExpressions()(Code)(Java Doc) public static QNameValue makeQNameValue(Object object, Configuration config)(Code)(Java Doc) public static CharSequence normalizeWhitespace(CharSequence in)(Code)(Java Doc) final public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType)(Code)(Java Doc) public void process(XPathContext context) throws XPathException(Code)(Java Doc) final public Expression promote(PromotionOffer offer)(Code)(Java Doc) public Value reduce() throws XPathException(Code)(Java Doc) public boolean schemaEquals(Value obj)(Code)(Java Doc) final public Expression simplify(StaticContext env)(Code)(Java Doc) public static double stringToNumber(CharSequence s) throws NumberFormatException(Code)(Java Doc) public String toString()(Code)(Java Doc) public static CharSequence trimWhitespace(CharSequence in)(Code)(Java Doc) final public Expression typeCheck(StaticContext env, ItemType contextItemType)(Code)(Java Doc)
|
|
|