/** * Multiply a duration by an integer * * @param factor the number to multiply by * @return the result of the multiplication */ public DurationValue multiply(long factor) throws XPathException { return multiply((double)factor); }
/** * Multiply a duration by an integer * * @param factor the number to multiply by * @return the result of the multiplication */ public DurationValue multiply(long factor) throws XPathException { return multiply((double)factor); }
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { double d = 1.0 / ((NumericValue)b).getDoubleValue(); return ((DurationValue)a).multiply(d); } public AtomicType getResultType(AtomicType typeA, AtomicType typeB) {
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { double d = 1.0 / ((NumericValue) b).getDoubleValue(); return ((DurationValue) a).multiply(d); }
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { double d = 1.0 / ((NumericValue)b).getDoubleValue(); return ((DurationValue)a).multiply(d); } public AtomicType getResultType(AtomicType typeA, AtomicType typeB) {
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { return ((CalendarValue)a).add(((DurationValue)b).multiply(-1.0)); } public AtomicType getResultType(AtomicType typeA, AtomicType typeB) {
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { return ((DurationValue)b).multiply(((NumericValue)a).getDoubleValue()); } public AtomicType getResultType(AtomicType typeA, AtomicType typeB) {
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { return ((DurationValue)a).multiply(((NumericValue)b).getDoubleValue()); } public AtomicType getResultType(AtomicType typeA, AtomicType typeB) {
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { return ((DurationValue)b).multiply(((NumericValue)a).getDoubleValue()); } public AtomicType getResultType(AtomicType typeA, AtomicType typeB) {
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { return ((CalendarValue)a).add(((DurationValue)b).multiply(-1.0)); } public AtomicType getResultType(AtomicType typeA, AtomicType typeB) {
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { double d = 1.0 / ((NumericValue) b).getDoubleValue(); return ((DurationValue) a).multiply(d); }
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { return ((DurationValue)a).multiply(((NumericValue)b).getDoubleValue()); } public AtomicType getResultType(AtomicType typeA, AtomicType typeB) {
/** * Computes a new duration whose value is <code>factor</code> times * longer than the value of this duration. * <p>This implementation follows the XPath semantics. This means that it is defined * only on yearMonthDuration and dayTimeDuration. Other cases produce an IllegalStateException.</p> * * @param factor to multiply by * @return returns a non-null valid <code>Duration</code> object * @throws IllegalStateException if operation produces fraction in * the months field. * @throws NullPointerException if the <code>factor</code> parameter is * <code>null</code>. */ public Duration multiply(BigDecimal factor) { try { return new SaxonDuration(duration.multiply(factor.doubleValue())); } catch (XPathException e) { throw new IllegalStateException(e.getMessage()); } }
/** * Computes a new duration whose value is <code>factor</code> times * longer than the value of this duration. * <p>This implementation follows the XPath semantics. This means that it is defined * only on yearMonthDuration and dayTimeDuration. Other cases produce an IllegalStateException.</p> * * @param factor to multiply by * @return returns a non-null valid <code>Duration</code> object * @throws IllegalStateException if operation produces fraction in * the months field. * @throws NullPointerException if the <code>factor</code> parameter is * <code>null</code>. */ public Duration multiply(BigDecimal factor) { try { return new SaxonDuration(duration.multiply(factor.doubleValue())); } catch (XPathException e) { throw new IllegalStateException(e.getMessage()); } }
AtomicValue next = (AtomicValue)iter.next(); if (next == null) { return ((DurationValue)item).multiply(1.0/count);
AtomicValue next = (AtomicValue)iter.next(); if (next == null) { return ((DurationValue)item).multiply(1.0/count);