/** * Finds and returns a group of nodes that can be appended to the given * parent node. * * @param potentialChildren * The given potential children * @param parentNode * The given parent node * @return list of nodes that can be appended to the given parent */ protected ArrayList getNodeListForParent(ArrayList potentialChildren, Node parentNode) { ArrayList children = new ArrayList(); int n = potentialChildren.size(); for (Object aPotentialChildren : potentialChildren) { Node node = (Node) aPotentialChildren; if (DOMUtilities.canAppend(node, parentNode)) { children.add(node); } } return children; } }
/** * Finds and returns a group of nodes that can be appended to the given * parent node. * * @param potentialChildren * The given potential children * @param parentNode * The given parent node * @return list of nodes that can be appended to the given parent */ protected ArrayList getNodeListForParent(ArrayList potentialChildren, Node parentNode) { ArrayList children = new ArrayList(); int n = potentialChildren.size(); for (int i = 0; i < n; i++) { Node node = (Node) potentialChildren.get(i); if (DOMUtilities.canAppend(node, parentNode)) { children.add(node); } } return children; } }
/** * Checks whether any of the nodes from the list can be appended to a given * parentNode. * * @param children * The given node list * @param parentNode * The potential parent node * @return true if at least one node from a list can be appended */ public static boolean canAppendAny(ArrayList children, Node parentNode) { if (!canHaveChildren(parentNode)) { return false; } int n = children.size(); for (Object aChildren : children) { Node child = (Node) aChildren; if (canAppend(child, parentNode)) { return true; } } return false; }
/** * Checks whether any of the nodes from the list can be appended to a given * parentNode. * * @param children * The given node list * @param parentNode * The potential parent node * @return true if at least one node from a list can be appended */ public static boolean canAppendAny(ArrayList children, Node parentNode) { if (!canHaveChildren(parentNode)) { return false; } int n = children.size(); for (Object aChildren : children) { Node child = (Node) aChildren; if (canAppend(child, parentNode)) { return true; } } return false; }
/** * Checks whether any of the nodes from the list can be appended to a given * parentNode. * * @param children * The given node list * @param parentNode * The potential parent node * @return true if at least one node from a list can be appended */ public static boolean canAppendAny(ArrayList children, Node parentNode) { if (!canHaveChildren(parentNode)) { return false; } int n = children.size(); for (int i = 0; i < n; i++) { Node child = (Node) children.get(i); if (canAppend(child, parentNode)) { return true; } } return false; }