/** * Accept nodes that are not acceptable to the predicate filter. * @param node The node to check. * @return <code>true</code> if the node is not acceptable to the * predicate filter, <code>false</code> otherwise. */ public boolean accept (Node node) { return ((null != mPredicate) && !mPredicate.accept (node)); } }
/** * Accept nodes that match the selector expression. * @param node The node to check. * @return <code>true</code> if the node matches, * <code>false</code> otherwise. */ public boolean accept (Node node) { return (therule.accept (node)); }
/** * Accept nodes that match the selector expression. * @param node The node to check. * @return <code>true</code> if the node matches, * <code>false</code> otherwise. */ public boolean accept (Node node) { return (therule.accept (node)); }
/** * Accept nodes that are not acceptable to the predicate filter. * @param node The node to check. * @return <code>true</code> if the node is not acceptable to the * predicate filter, <code>false</code> otherwise. */ public boolean accept (Node node) { return ((null != mPredicate) && !mPredicate.accept (node)); } }
/** * Accept nodes that are acceptable to all of it's predicate filters. * @param node The node to check. * @return <code>true</code> if all the predicate filters find the node * is acceptable, <code>false</code> otherwise. */ public boolean accept (Node node) { boolean ret; ret = true; for (int i = 0; ret && (i < mPredicates.length); i++) if (!mPredicates[i].accept (node)) ret = false; return (ret); } }
/** * Accept nodes that are acceptable to any of its predicate filters. * @param node The node to check. * @return <code>true</code> if any of the predicate filters find the node * is acceptable, <code>false</code> otherwise. */ public boolean accept (Node node) { boolean ret; ret = false; for (int i = 0; !ret && (i < mPredicates.length); i++) if (mPredicates[i].accept (node)) ret = true; return (ret); } }
/** * Accept nodes that are acceptable to all of its predicate filters. * @param node The node to check. * @return <code>true</code> if all the predicate filters find the node * is acceptable, <code>false</code> otherwise. */ public boolean accept (Node node) { boolean ret; ret = true; for (int i = 0; ret && (i < mPredicates.length); i++) if (!mPredicates[i].accept (node)) ret = false; return (ret); } }
/** * Accept nodes that are acceptable to any of it's predicate filters. * @param node The node to check. * @return <code>true</code> if any of the predicate filters find the node * is acceptable, <code>false</code> otherwise. */ public boolean accept (Node node) { boolean ret; ret = false; for (int i = 0; !ret && (i < mPredicates.length); i++) if (mPredicates[i].accept (node)) ret = true; return (ret); } }
public boolean accept(Node n) { while (n != null) { n = n.getParent(); if (atest.accept(n)) return true; } return false; } }
public boolean accept (Node n) { while (n != null) { n = n.getParent (); if (atest.accept (n)) return (true); } return (false); } }
/** * 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++; } } }
public boolean accept (Node n) { if (n.getParent () != null) { NodeList l = n.getParent ().getChildren (); for (int i = 0; i < l.size (); i++) if (l.elementAt (i) == n && i > 0) return (sibtest.accept (l.elementAt (i - 1))); } return (false); } }
public boolean accept(Node n) { if (n.getParent() != null) { NodeList l = n.getParent().getChildren(); for (int i = 0; i < l.size(); i++) if (l.elementAt(i) == n && i > 0) return (sibtest.accept(l.elementAt(i - 1))); } return false; } }
/** * Filter the list with the given filter. * @param filter The filter to use. * @param recursive If <code>true<code> digs into the children recursively. * @return A new node array containing the nodes accepted by the filter. * This is a linear list and preserves the nested structure of the returned * nodes only. */ public NodeList extractAllNodesThatMatch (NodeFilter filter, boolean recursive) { Node node; NodeList children; NodeList ret; ret = new NodeList (); for (int i = 0; i < size; i++) { node = nodeData[i]; if (filter.accept (node)) ret.add (node); if (recursive) { children = node.getChildren (); if (null != children) ret.add (children.extractAllNodesThatMatch (filter, recursive)); } } return (ret); }
/** * Filter the list with the given filter. * @param filter The filter to use. * @param recursive If <code>true<code> digs into the children recursively. * @return A new node array containing the nodes accepted by the filter. * This is a linear list and preserves the nested structure of the returned * nodes only. */ public NodeList extractAllNodesThatMatch (NodeFilter filter, boolean recursive) { Node node; NodeList children; NodeList ret; ret = new NodeList (); for (int i = 0; i < size; i++) { node = nodeData[i]; if (filter.accept (node)) ret.add (node); if (recursive) { children = node.getChildren (); if (null != children) ret.add (children.extractAllNodesThatMatch (filter, recursive)); } } return (ret); }
/** * Accept tags with parent acceptable to the filter. * If recursion is enabled, each parent in turn up to * the topmost enclosing node is checked. * Recursion only proceeds while no parent satisfies the * filter. * @param node The node to check. * @return <code>true</code> if the node has an acceptable parent, * <code>false</code> otherwise. */ public boolean accept (Node node) { Node parent; boolean ret; ret = false; if (!(node instanceof Tag) || !((Tag)node).isEndTag ()) { parent = node.getParent (); if ((null != parent) && (null != getParentFilter ())) { ret = getParentFilter ().accept (parent); if (!ret && getRecursive ()) ret = accept (parent); } } return (ret); } }
/** * Accept tags with parent acceptable to the filter. * If recursion is enabled, each parent in turn up to * the topmost enclosing node is checked. * Recursion only proceeds while no parent satisfies the * filter. * @param node The node to check. * @return <code>true</code> if the node has an acceptable parent, * <code>false</code> otherwise. */ public boolean accept (Node node) { Node parent; boolean ret; ret = false; if (!(node instanceof Tag) || !((Tag)node).isEndTag ()) { parent = node.getParent (); if ((null != parent) && (null != getParentFilter ())) { ret = getParentFilter ().accept (parent); if (!ret && getRecursive ()) ret = accept (parent); } } return (ret); } }
if (getSiblingFilter ().accept (siblings.elementAt (i))) ret = true;
if (getChildFilter ().accept (children.elementAt (i))) ret = true;