use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate in project webtools.sourceediting by eclipse.
the class FnYearFromDate method expected_args.
/**
* Obtain a list of expected arguments.
*
* @return Result of operation.
*/
public static synchronized Collection expected_args() {
if (_expected_args == null) {
_expected_args = new ArrayList();
_expected_args.add(new SeqType(new XSDate(), SeqType.OCC_QMARK));
}
return _expected_args;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate in project webtools.sourceediting by eclipse.
the class XSDate method constructor.
/**
* Creates a new result sequence consisting of the retrievable date value in
* the supplied result sequence
*
* @param arg
* The result sequence from which to extract the date value.
* @throws DynamicError
* @return A new result sequence consisting of the date value supplied.
*/
public ResultSequence constructor(ResultSequence arg) throws DynamicError {
if (arg.empty())
return ResultBuffer.EMPTY;
Item aat = arg.first();
if (!isCastable(aat)) {
throw DynamicError.invalidType();
}
XSDate dt = castDate(aat);
if (dt == null)
throw DynamicError.cant_cast(null);
return dt;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDate in project webtools.sourceediting by eclipse.
the class XSDate method lt.
/**
* Comparison on this and the supplied dates (taking timezones into account)
*
* @param arg
* XSDate representation of the date to compare to
* @throws DynamicError
* @return True if in time, this date lies before the date supplied. False
* otherwise.
*/
public boolean lt(AnyType arg, DynamicContext context) throws DynamicError {
XSDate val = (XSDate) NumericType.get_single_type((Item) arg, XSDate.class);
Calendar thiscal = normalizeCalendar(calendar(), tz());
Calendar thatcal = normalizeCalendar(val.calendar(), val.tz());
return thiscal.before(thatcal);
}
Aggregations