Package org.htmlparser.filters
Class NotFilter
- java.lang.Object
-
- org.htmlparser.filters.NotFilter
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,NodeFilter
public class NotFilter extends java.lang.Object implements NodeFilter
Accepts all nodes not acceptable to it's predicate filter.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected NodeFilter
mPredicate
The filter to gainsay.
-
Constructor Summary
Constructors Constructor Description NotFilter()
Creates a new instance of a NotFilter.NotFilter(NodeFilter predicate)
Creates a NotFilter that accepts nodes not acceptable to the predicate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(Node node)
Accept nodes that are not acceptable to the predicate filter.NodeFilter
getPredicate()
Get the predicate used by this NotFilter.void
setPredicate(NodeFilter predicate)
Set the predicate for this NotFilter.
-
-
-
Field Detail
-
mPredicate
protected NodeFilter mPredicate
The filter to gainsay.
-
-
Constructor Detail
-
NotFilter
public NotFilter()
Creates a new instance of a NotFilter. With no predicates, this would always returnfalse
fromaccept(org.htmlparser.Node)
.- See Also:
setPredicate(org.htmlparser.NodeFilter)
-
NotFilter
public NotFilter(NodeFilter predicate)
Creates a NotFilter that accepts nodes not acceptable to the predicate.- Parameters:
predicate
- The filter to consult.
-
-
Method Detail
-
getPredicate
public NodeFilter getPredicate()
Get the predicate used by this NotFilter.- Returns:
- The predicate currently in use.
-
setPredicate
public void setPredicate(NodeFilter predicate)
Set the predicate for this NotFilter.- Parameters:
predicate
- The predidcate to use inaccept(org.htmlparser.Node)
.
-
accept
public boolean accept(Node node)
Accept nodes that are not acceptable to the predicate filter.- Specified by:
accept
in interfaceNodeFilter
- Parameters:
node
- The node to check.- Returns:
true
if the node is not acceptable to the predicate filter,false
otherwise.
-
-