Package org.htmlparser.filters
Class AndFilter
java.lang.Object
org.htmlparser.filters.AndFilter
- All Implemented Interfaces:
Serializable
,Cloneable
,NodeFilter
Accepts nodes matching all of its predicate filters (AND operation).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected NodeFilter[]
The predicates that are to be and'ed together; -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of an AndFilter.AndFilter
(NodeFilter[] predicates) Creates an AndFilter that accepts nodes acceptable to all given filters.AndFilter
(NodeFilter left, NodeFilter right) Creates an AndFilter that accepts nodes acceptable to both filters. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Accept nodes that are acceptable to all of its predicate filters.Get the predicates used by this AndFilter.void
setPredicates
(NodeFilter[] predicates) Set the predicates for this AndFilter.
-
Field Details
-
mPredicates
The predicates that are to be and'ed together;
-
-
Constructor Details
-
AndFilter
public AndFilter()Creates a new instance of an AndFilter. With no predicates, this would always answertrue
toaccept(org.htmlparser.Node)
.- See Also:
-
AndFilter
Creates an AndFilter that accepts nodes acceptable to both filters.- Parameters:
left
- One filter.right
- The other filter.
-
AndFilter
Creates an AndFilter that accepts nodes acceptable to all given filters.- Parameters:
predicates
- The list of filters.
-
-
Method Details
-
getPredicates
Get the predicates used by this AndFilter.- Returns:
- The predicates currently in use.
-
setPredicates
Set the predicates for this AndFilter.- Parameters:
predicates
- The list of predidcates to use inaccept(org.htmlparser.Node)
.
-
accept
Accept nodes that are acceptable to all of its predicate filters.- Specified by:
accept
in interfaceNodeFilter
- Parameters:
node
- The node to check.- Returns:
true
if all the predicate filters find the node is acceptable,false
otherwise.
-