org.htmlparser.filters
Class XorFilter
- Cloneable, NodeFilter, Serializable
Accepts nodes matching an odd number of its predicates filters (XOR operation).
For example, where it has two filters, it accepts only if and only if one of the two filters accepts the Node, but does not accept if both filters accept the Node.
XorFilter() - Creates a new instance of an XorFilter.
|
XorFilter(NodeFilter left, NodeFilter right) - Creates an XorFilter that accepts nodes acceptable to either filter, but not both.
|
XorFilter(NodeFilter[] predicates) - Creates an XorFilter that accepts nodes acceptable an odd number of the given filters.
|
mPredicates
protected NodeFilter[] mPredicates
The predicates that are to be xor'ed together;
XorFilter
public XorFilter()
Creates a new instance of an XorFilter.
With no predicates, this would always answer
false
to
accept(Node)
.
XorFilter
public XorFilter(NodeFilter left,
NodeFilter right)
Creates an XorFilter that accepts nodes acceptable to either filter, but not both.
left
- One filter.right
- The other filter.
XorFilter
public XorFilter(NodeFilter[] predicates)
Creates an XorFilter that accepts nodes acceptable an odd number of the given filters.
predicates
- The list of filters.
accept
public boolean accept(Node node)
Accept nodes that are acceptable to an odd number of its predicate filters.
- accept in interface NodeFilter
node
- The node to check.
true
if an odd number of the predicate filters find the node
is acceptable, false
otherwise.
getPredicates
public NodeFilter[] getPredicates()
Get the predicates used by this XorFilter.
- The predicates currently in use.
setPredicates
public void setPredicates(NodeFilter[] predicates)
Set the predicates for this XorFilter.
predicates
- The list of predidcates to use in accept(Node)
.
| © 2005 Derrick Oswald Mai 08, 2008 |
HTML Parser is an open source library released under LGPL. |  |