Class AndFilter

java.lang.Object
org.htmlparser.filters.AndFilter
All Implemented Interfaces:
Serializable, Cloneable, NodeFilter

public class AndFilter extends Object implements NodeFilter
Accepts nodes matching all of its predicate filters (AND operation).
See Also:
  • Field Details

    • mPredicates

      protected NodeFilter[] 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 answer true to accept(org.htmlparser.Node).
      See Also:
    • 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.
    • AndFilter

      public AndFilter(NodeFilter[] predicates)
      Creates an AndFilter that accepts nodes acceptable to all given filters.
      Parameters:
      predicates - The list of filters.
  • Method Details

    • 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 its 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.