java.io.Serializable
, java.lang.Cloneable
, NodeFilter
public class XorFilter extends java.lang.Object implements NodeFilter
Modifier and Type | Field | Description |
---|---|---|
protected NodeFilter[] |
mPredicates |
The predicates that are to be xor'ed together;
|
Constructor | Description |
---|---|
XorFilter() |
Creates a new instance of an XorFilter.
|
XorFilter(NodeFilter[] predicates) |
Creates an XorFilter that accepts nodes acceptable an odd number of the given filters.
|
XorFilter(NodeFilter left,
NodeFilter right) |
Creates an XorFilter that accepts nodes acceptable to either filter, but not both.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
accept(Node node) |
Accept nodes that are acceptable to an odd number of its predicate filters.
|
NodeFilter[] |
getPredicates() |
Get the predicates used by this XorFilter.
|
void |
setPredicates(NodeFilter[] predicates) |
Set the predicates for this XorFilter.
|
protected NodeFilter[] mPredicates
public XorFilter()
false
to accept(org.htmlparser.Node)
.public XorFilter(NodeFilter left, NodeFilter right)
left
- One filter.right
- The other filter.public XorFilter(NodeFilter[] predicates)
predicates
- The list of filters.public NodeFilter[] getPredicates()
public void setPredicates(NodeFilter[] predicates)
predicates
- The list of predidcates to use in accept(org.htmlparser.Node)
.public boolean accept(Node node)
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.HTML Parser is an open source library released under LGPL.