public void add(int index, E element) { if (index == 0) { addFirst(element); return;
public void add(int index, E element) { if (index == 0) { addFirst(element); return;
/** * Walks over the child notes, maintaining the tree order and not using recursion. */ protected void walkDescendantsIteratively(JoddArrayList<Node> nodes, CssSelector cssSelector, List<Node> result) { while (!nodes.isEmpty()) { Node node = nodes.removeFirst(); selectAndAdd(node, cssSelector, result); // append children in walking order to be processed right after this node int childCount = node.getChildNodesCount(); for (int i = childCount - 1; i >= 0; i--) { nodes.addFirst(node.getChild(i)); } } }