The list of methods to do XML Duration Add are organized into topic(s).
Duration
add(Duration d1, Duration d2) Add one Duration to another, avoiding the runtime library bug that gives incorrect results when using decimal seconds.
boolean sign1 = d1.getSign() >= 0;
boolean sign2 = d2.getSign() >= 0;
if (sign1 && sign2)
return addPositiveDurations(d1, d2);
if (!sign1 && !sign2)
return addPositiveDurations(d1.negate(), d2.negate()).negate();
if (sign1 && !sign2)
return subtract(d1, d2.negate());
...
Duration
add(Duration... durations) Adds the given list of durations together, returning the result.
Duration result = DATATYPE_FACTORY.newDuration(0);
if (durations != null) {
for (int i = 0; i < durations.length; i++) {
if (durations[i] != null) {
result = result.add(durations[i]);
return result;
Element
addElement(Node parent, String elementName) Add an Element node to the supplied parent name.
Element element = null;
if (parent instanceof Document) {
element = ((Document) parent).createElement(elementName);
} else {
element = parent.getOwnerDocument().createElement(elementName);
parent.appendChild(element);
return element;
...
Element
addElement(Node parent, String name) add Element
Element node;
if (parent.getOwnerDocument() != null)
node = parent.getOwnerDocument().createElement(name);
else if (parent instanceof Document)
node = ((Document) parent).createElement(name);
else
return null;
parent.appendChild(node);
...