/** * Search in @param nodes for an equivalent node to @param node * (equivalent as defined by areNodesEqual) starting the search * at position @param start, giving up the search at position * @param maxPosition. */ private int findInNodeList(NodeList nodes, Node node, int start, int maxPosition) { for (; start < maxPosition; ++start) { if (areNodesEqual(nodes.item(start), node)) return start; } return -1; }