/** * Check to see if the NodeList contains the supplied Node. * @param node The node to look for. * @return True is the Node is in this NodeList. */ public boolean contains (Node node) { return (-1 != indexOf (node)); }
/** * Remove the supplied Node from the list. * @param node The node to remove. * @return True if the node was found and removed from the list. */ public boolean remove (Node node) { int index; boolean ret; ret = false; if (-1 != (index = indexOf (node))) { remove (index); ret = true; } return (ret); }
private void insertRowAfter(Row existingRow, Row childRow) { NodeList rowNodes = tableNode.getChildren(); int index = rowNodes.indexOf(existingRow.rowNode); Stack<Node> tempStack = new Stack<>(); while (rowNodes.size() - 1 > index) { tempStack.push(rowNodes.elementAt(tableNode.getChildren().size() - 1)); rowNodes.remove(rowNodes.size() - 1); } rowNodes.add(childRow.rowNode); while (!tempStack.isEmpty()) { rowNodes.add(tempStack.pop()); } }
private void insertRowAfter(Row existingRow, Row childRow) { NodeList rowNodes = tableNode.getChildren(); int index = rowNodes.indexOf(existingRow.rowNode); Stack<Node> tempStack = new Stack<>(); while (rowNodes.size() - 1 > index) { tempStack.push(rowNodes.elementAt(tableNode.getChildren().size() - 1)); rowNodes.remove(rowNodes.size() - 1); } rowNodes.add(childRow.rowNode); while (!tempStack.isEmpty()) { rowNodes.add(tempStack.pop()); } }