org.htmlparser.filters
Class AndFilter

java.lang.Object
  extended byorg.htmlparser.filters.AndFilter
All Implemented Interfaces:
java.lang.Cloneable, NodeFilter, java.io.Serializable

public class AndFilter
extends java.lang.Object
implements NodeFilter

Accepts nodes matching all of it's predicate filters (AND operation).

See Also:
Serialized Form

Field Summary
protected  NodeFilter[] mPredicates
          The predicates that are to be and'ed together;
 
Constructor Summary
AndFilter()
          Creates a new instance of an AndFilter.
AndFilter(NodeFilter left, NodeFilter right)
          Creates an AndFilter that accepts nodes acceptable to both filters.
 
Method Summary
 boolean accept(Node node)
          Accept nodes that are acceptable to all of it's predicate filters.
 NodeFilter[] getPredicates()
          Get the predicates used by this AndFilter.
 void setPredicates(NodeFilter[] predicates)
          Set the predicates for this AndFilter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mPredicates

protected NodeFilter[] mPredicates
The predicates that are to be and'ed together;

Constructor Detail

AndFilter

public AndFilter()
Creates a new instance of an AndFilter. With no predicates, this would always answer true to accept(org.htmlparser.Node).

See Also:
setPredicates(org.htmlparser.NodeFilter[])

AndFilter

public AndFilter(NodeFilter left,
                 NodeFilter right)
Creates an AndFilter that accepts nodes acceptable to both filters.

Parameters:
left - One filter.
right - The other filter.
Method Detail

getPredicates

public NodeFilter[] getPredicates()
Get the predicates used by this AndFilter.

Returns:
The predicates currently in use.

setPredicates

public void setPredicates(NodeFilter[] predicates)
Set the predicates for this AndFilter.

Parameters:
predicates - The list of predidcates to use in accept(org.htmlparser.Node).

accept

public boolean accept(Node node)
Accept nodes that are acceptable to all of it's predicate filters.

Specified by:
accept in interface NodeFilter
Parameters:
node - The node to check.
Returns:
true if all the predicate filters find the node is acceptable, false otherwise.