public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { return ((DurationValue) a).subtract((DurationValue) b); }
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { return ((DurationValue)a).subtract((DurationValue)b); } public AtomicType getResultType(AtomicType typeA, AtomicType typeB) {
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { return ((DurationValue)a).subtract((DurationValue)b); } public AtomicType getResultType(AtomicType typeA, AtomicType typeB) {
public AtomicValue compute(AtomicValue a, AtomicValue b, XPathContext c) throws XPathException { return ((DurationValue) a).subtract((DurationValue) b); }
/** * <p>Computes a new duration whose value is <code>this-rhs</code>.</p> * <p>This implementation follows the XPath semantics. This means that the operation will fail * if the duration is not a yearMonthDuration or a dayTimeDuration. * * @param rhs <code>Duration</code> to subtract from this <code>Duration</code> * @return non-null valid Duration object. * @throws NullPointerException If the rhs parameter is null. * @throws IllegalStateException If the durations are not both dayTimeDurations, or * both yearMonthDurations. * @see #add(javax.xml.datatype.Duration) */ public Duration subtract(Duration rhs) { try { return new SaxonDuration(duration.subtract(((SaxonDuration) rhs).duration)); } catch (XPathException e) { throw new IllegalStateException(e.getMessage()); } }
/** * <p>Computes a new duration whose value is <code>this-rhs</code>.</p> * <p>This implementation follows the XPath semantics. This means that the operation will fail * if the duration is not a yearMonthDuration or a dayTimeDuration. * * @param rhs <code>Duration</code> to subtract from this <code>Duration</code> * @return non-null valid Duration object. * @throws NullPointerException If the rhs parameter is null. * @throws IllegalStateException If the durations are not both dayTimeDurations, or * both yearMonthDurations. * @see #add(javax.xml.datatype.Duration) */ public Duration subtract(Duration rhs) { try { return new SaxonDuration(duration.subtract(((SaxonDuration) rhs).duration)); } catch (XPathException e) { throw new IllegalStateException(e.getMessage()); } }