|
HTML Parser Home Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.htmlparser.filters.XorFilter
public class XorFilter
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.
Field Summary | |
---|---|
protected NodeFilter[] |
mPredicates
The predicates that are to be xor'ed together; |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected NodeFilter[] mPredicates
Constructor Detail |
---|
public XorFilter()
false
to accept(org.htmlparser.Node)
.
setPredicates(org.htmlparser.NodeFilter[])
public XorFilter(NodeFilter left, NodeFilter right)
left
- One filter.right
- The other filter.public XorFilter(NodeFilter[] predicates)
predicates
- The list of filters.Method Detail |
---|
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.
|
© 2005 Derrick Oswald Jun 10, 2006
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
HTML Parser is an open source library released under LGPL. | |