/** * 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); }
/** * Remove the child at the position given. * @param i The index of the child to remove. */ public void removeChild (int i) { if (null != getChildren ()) getChildren ().remove (i); }
/** * Remove the child at the position given. * @param i The index of the child to remove. */ public void removeChild (int i) { if (null != getChildren ()) getChildren ().remove (i); }
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()); } }
/** * Remove nodes not matching the given filter. * @param filter The filter to use. * @param recursive If <code>true<code> digs into the children recursively. */ public void keepAllNodesThatMatch (NodeFilter filter, boolean recursive) { Node node; NodeList children; for (int i = 0; i < size; ) { node = nodeData[i]; if (!filter.accept (node)) remove (i); else { if (recursive) { children = node.getChildren (); if (null != children) children.keepAllNodesThatMatch (filter, recursive); } i++; } } }
/** * Remove nodes not matching the given filter. * @param filter The filter to use. * @param recursive If <code>true<code> digs into the children recursively. */ public void keepAllNodesThatMatch (NodeFilter filter, boolean recursive) { Node node; NodeList children; for (int i = 0; i < size; ) { node = nodeData[i]; if (!filter.accept (node)) remove (i); else { if (recursive) { children = node.getChildren (); if (null != children) children.keepAllNodesThatMatch (filter, recursive); } i++; } } }
if ((k!=j) && (kStartTagBegin>jStartTagBegin) && (kEndTagEnd<jEndTagEnd)) links.remove(k); k--; j--;
if ((k!=j) && (kStartTagBegin>jStartTagBegin) && (kEndTagEnd<jEndTagEnd)) links.remove(k); k--; j--;
if ((k!=j) && (kStartTagBegin>jStartTagBegin) && (kEndTagEnd<jEndTagEnd)) links.remove(k); k--; j--;
if ((k!=j) && (kStartTagBegin>jStartTagBegin) && (kEndTagEnd<jEndTagEnd)) links.remove(k); k--; j--;