/** * Get all preceding siblings of each element in the set of matched * elements, optionally filtered by a selector. */ public Jerry prevAll() { List<Node> result = new NodeList(nodes.length); if (nodes.length > 0) { for (Node node : nodes) { Node currentSiblingElement = node.getPreviousSiblingElement(); while (currentSiblingElement != null) { result.add(currentSiblingElement); currentSiblingElement = currentSiblingElement.getPreviousSiblingElement(); } } } return new Jerry(this, result); }
/** * Gets the immediately preceding sibling of each element in the * set of matched elements. */ public Jerry prev() { List<Node> result = new NodeList(nodes.length); if (nodes.length > 0) { for (Node node : nodes) { result.add(node.getPreviousSiblingElement()); } } return new Jerry(this, result); }
assertEquals(t1, t3.getPreviousSiblingElement().getPreviousSiblingElement().getPreviousSibling()); assertEquals(p1, p2.getPreviousSiblingElement()); assertEquals(t1, p2.getPreviousSibling());
/** * Get all preceding siblings of each element in the set of matched * elements, optionally filtered by a selector. */ public Jerry prevAll() { List<Node> result = new NodeList(nodes.length); if (nodes.length > 0) { for (Node node : nodes) { Node currentSiblingElement = node.getPreviousSiblingElement(); while (currentSiblingElement != null) { result.add(currentSiblingElement); currentSiblingElement = currentSiblingElement.getPreviousSiblingElement(); } } } return new Jerry(this, result); }
/** * Gets the immediately preceding sibling of each element in the * set of matched elements. */ public Jerry prev() { List<Node> result = new NodeList(nodes.length); for (Node node : nodes) { result.add(node.getPreviousSiblingElement()); } return new Jerry(this, result); }
/** * Gets the immediately preceding sibling of each element in the * set of matched elements. */ public Jerry prev() { List<Node> result = new NodeList(nodes.length); for (Node node : nodes) { result.add(node.getPreviousSiblingElement()); } return new Jerry(this, result); }
/** * Gets the immediately preceding sibling of each element in the * set of matched elements. */ public Jerry prev() { List<Node> result = new NodeList(nodes.length); if (nodes.length > 0) { for (Node node : nodes) { result.add(node.getPreviousSiblingElement()); } } return new Jerry(this, result); }