use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDouble in project webtools.sourceediting by eclipse.
the class XSDayTimeDuration method times.
/**
* Mathematical multiplication between this duration stored and the supplied
* duration of time (of type XSDayTimeDuration)
*
* @param arg
* The duration of time to multiply by
* @return New XSDayTimeDuration representing the resulting duration after
* the multiplication
* @throws DynamicError
*/
public ResultSequence times(ResultSequence arg) throws DynamicError {
ResultSequence convertedRS = arg;
if (arg.size() == 1) {
Item argValue = arg.first();
if (argValue instanceof XSDecimal) {
convertedRS = ResultSequenceFactory.create_new(new XSDouble(argValue.getStringValue()));
}
}
XSDouble val = (XSDouble) NumericType.get_single_type(convertedRS, XSDouble.class);
if (val.nan()) {
throw DynamicError.nan();
}
double res = value() * val.double_value();
return ResultSequenceFactory.create_new(new XSDayTimeDuration(res));
}
Aggregations