Package org.htmlparser.filters
Class OrFilter
java.lang.Object
org.htmlparser.filters.OrFilter
- All Implemented Interfaces:
Serializable,Cloneable,NodeFilter
Accepts nodes matching any of its predicates filters (OR operation).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected NodeFilter[]The predicates that are to be or'ed together; -
Constructor Summary
ConstructorsConstructorDescriptionOrFilter()Creates a new instance of an OrFilter.OrFilter(NodeFilter[] predicates) Creates an OrFilter that accepts nodes acceptable to any of the given filters.OrFilter(NodeFilter left, NodeFilter right) Creates an OrFilter that accepts nodes acceptable to either filter. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAccept nodes that are acceptable to any of its predicate filters.Get the predicates used by this OrFilter.voidsetPredicates(NodeFilter[] predicates) Set the predicates for this OrFilter.
-
Field Details
-
mPredicates
The predicates that are to be or'ed together;
-
-
Constructor Details
-
OrFilter
public OrFilter()Creates a new instance of an OrFilter. With no predicates, this would always answerfalsetoaccept(org.htmlparser.Node). -
OrFilter
Creates an OrFilter that accepts nodes acceptable to either filter.- Parameters:
left- One filter.right- The other filter.
-
OrFilter
Creates an OrFilter that accepts nodes acceptable to any of the given filters.- Parameters:
predicates- The list of filters.
-
-
Method Details
-
getPredicates
Get the predicates used by this OrFilter.- Returns:
- The predicates currently in use.
-
setPredicates
Set the predicates for this OrFilter.- Parameters:
predicates- The list of predidcates to use inaccept(org.htmlparser.Node).
-
accept
Accept nodes that are acceptable to any of its predicate filters.- Specified by:
acceptin interfaceNodeFilter- Parameters:
node- The node to check.- Returns:
trueif any of the predicate filters find the node is acceptable,falseotherwise.
-