/** * Iterates over a jQuery object, executing a function for * each matched element. * @see #eachNode(JerryNodeFunction) */ public Jerry each(final JerryFunction function) { for (int i = 0; i < nodes.length; i++) { Node node = nodes[i]; Jerry $this = new Jerry(this, node); Boolean result = function.onNode($this, i); if (result != null && result == Boolean.FALSE) { break; } } return this; }
/** * Reduces the set of matched elements to those that pass the * {@link JerryFunction function's} test. */ public Jerry filter(final JerryFunction jerryFunction) { List<Node> result = new NodeList(nodes.length); for (int i = 0; i < nodes.length; i++) { Node node = nodes[i]; Node parentNode = node.getParentNode(); if (parentNode == null) { continue; } Jerry $this = new Jerry(this, node); boolean accept = jerryFunction.onNode($this, i); if (accept) { result.add(node); } } return new Jerry(this, result); }
/** * Iterates over a jQuery object, executing a function for * each matched element. */ public Jerry each(JerryFunction function) { for (int i = 0; i < nodes.length; i++) { Node node = nodes[i]; Jerry $this = new Jerry(this, node); if (function.onNode($this, i) == false) { break; } } return this; }
/** * Iterates over a jQuery object, executing a function for * each matched element. * @see #eachNode(JerryNodeFunction) */ public Jerry each(final JerryFunction function) { for (int i = 0; i < nodes.length; i++) { Node node = nodes[i]; Jerry $this = new Jerry(this, node); Boolean result = function.onNode($this, i); if (result != null && result == Boolean.FALSE) { break; } } return this; }
/** * Reduces the set of matched elements to those that pass the * {@link JerryFunction function's} test. */ public Jerry filter(JerryFunction jerryFunction) { List<Node> result = new NodeList(nodes.length); for (int i = 0; i < nodes.length; i++) { Node node = nodes[i]; Node parentNode = node.getParentNode(); if (parentNode == null) { continue; } Jerry $this = new Jerry(this, node); boolean accept = jerryFunction.onNode($this, i); if (accept) { result.add(node); } } return new Jerry(this, result); }
/** * Reduces the set of matched elements to those that pass the * {@link JerryFunction function's} test. */ public Jerry filter(final JerryFunction jerryFunction) { List<Node> result = new NodeList(nodes.length); for (int i = 0; i < nodes.length; i++) { Node node = nodes[i]; Node parentNode = node.getParentNode(); if (parentNode == null) { continue; } Jerry $this = new Jerry(this, node); boolean accept = jerryFunction.onNode($this, i); if (accept) { result.add(node); } } return new Jerry(this, result); }