org.htmlparser.filters

Class NotFilter

public class NotFilter extends Object implements NodeFilter

Accepts all nodes not acceptable to it's predicate filter.
Field Summary
protected NodeFiltermPredicate
The filter to gainsay.
Constructor Summary
NotFilter()
Creates a new instance of a NotFilter.
NotFilter(NodeFilter predicate)
Creates a NotFilter that accepts nodes not acceptable to the predicate.
Method Summary
booleanaccept(Node node)
Accept nodes that are not acceptable to the predicate filter.
NodeFiltergetPredicate()
Get the predicate used by this NotFilter.
voidsetPredicate(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 return false from NotFilter.

See Also: NotFilter

NotFilter

public NotFilter(NodeFilter predicate)
Creates a NotFilter that accepts nodes not acceptable to the predicate.

Parameters: predicate The filter to consult.

Method Detail

accept

public boolean accept(Node node)
Accept nodes that are not acceptable to the predicate filter.

Parameters: node The node to check.

Returns: true if the node is not acceptable to the predicate filter, false otherwise.

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 in NotFilter.

HTML Parser is an open source library released under LGPL. SourceForge.net