* pointer to the descendant subtree
*/
protected FONode firstChild;
+ protected FONode lastChild;
/** The list of extension attachments, null if none */
- private List/*<ExtensionAttachment>*/ extensionAttachments = null;
+ private List<ExtensionAttachment> extensionAttachments = null;
/** The map of foreign attributes, null if none */
- private Map/*<QName,String>*/ foreignAttributes = null;
+ private Map<QName, String> foreignAttributes = null;
/** Used to indicate if this FO is either an Out Of Line FO (see rec)
* or a descendant of one. Used during FO validation.
} else {
if (firstChild == null) {
firstChild = child;
+ lastChild = child;
} else {
- FONode prevChild = firstChild;
- while (prevChild.siblings != null
- && prevChild.siblings[1] != null) {
- prevChild = prevChild.siblings[1];
+ if (lastChild == null) {
+ FONode prevChild = firstChild;
+ while (prevChild.siblings != null
+ && prevChild.siblings[1] != null) {
+ prevChild = prevChild.siblings[1];
+ }
+ FONode.attachSiblings(prevChild, child);
+ } else {
+ FONode.attachSiblings(lastChild, child);
+ lastChild = child;
}
- FONode.attachSiblings(prevChild, child);
}
}
}
nextChild.siblings[0] = prevChild;
}
}
+ if (child == lastChild) {
+ if (child.siblings != null) {
+ lastChild = siblings[0];
+ } else {
+ lastChild = null;
+ }
+ }
}
/**
* Convenience method for validity checking. Checks if the
* incoming node is a member of the "%block;" parameter entity
* as defined in Sect. 6.2 of the XSL 1.0 & 1.1 Recommendations
+ *
* @param nsURI namespace URI of incoming node
* @param lName local name (i.e., no prefix) of incoming node
* @return true if a member, false if not
* Convenience method for validity checking. Checks if the
* incoming node is a member of the "%inline;" parameter entity
* as defined in Sect. 6.2 of the XSL 1.0 & 1.1 Recommendations
+ *
* @param nsURI namespace URI of incoming node
* @param lName local name (i.e., no prefix) of incoming node
* @return true if a member, false if not
/** @return whether this object has an id set */
public boolean hasId() {
- return id != null && id.length() > 0;
+ return (id != null && id.length() > 0);
}
/** {@inheritDoc} */
"Parameter attachment must not be null");
}
if (extensionAttachments == null) {
- extensionAttachments = new java.util.ArrayList/*<ExtensionAttachment>*/();
+ extensionAttachments = new java.util.ArrayList<ExtensionAttachment>();
}
if (log.isDebugEnabled()) {
log.debug("ExtensionAttachment of category "
throw new NullPointerException("Parameter attributeName must not be null");
}
if (foreignAttributes == null) {
- foreignAttributes = new java.util.HashMap/*<QName,String>*/();
+ foreignAttributes = new java.util.HashMap<QName, String>();
}
foreignAttributes.put(attributeName, value);
}
&& currentNode.siblings[1] != null) {
FONode.attachSiblings(newNode, currentNode.siblings[1]);
}
+ if (currentNode == parentNode.lastChild) {
+ parentNode.lastChild = newNode;
+ }
} else {
throw new IllegalStateException();
}
parentNode.firstChild = newNode;
currentIndex = 0;
currentNode = newNode;
+ if (parentNode.lastChild == null) {
+ parentNode.lastChild = newNode;
+ }
} else {
if (currentNode.siblings != null
&& currentNode.siblings[1] != null) {
FONode.attachSiblings((FONode) o, currentNode.siblings[1]);
}
FONode.attachSiblings(currentNode, (FONode) o);
+ if (currentNode == parentNode.lastChild) {
+ parentNode.lastChild = newNode;
+ }
}
flags &= F_NONE_ALLOWED;
}