Tabnine Logo
NodeSelector.filter
Code IndexAdd Tabnine to your IDE (free)

How to use
filter
method
in
jodd.lagarto.dom.NodeSelector

Best Java code snippets using jodd.lagarto.dom.NodeSelector.filter (Showing top 4 results out of 315)

origin: oblac/jodd

protected List<Node> select(final Node rootNode, final List<CssSelector> selectors) {
  // start with the root node
  List<Node> nodes = new ArrayList<>();
  nodes.add(rootNode);
  // iterate all selectors
  for (CssSelector cssSelector : selectors) {
    // create new set of results for current css selector
    List<Node> selectedNodes = new ArrayList<>();
    for (Node node : nodes) {
      walk(node, cssSelector, selectedNodes);
    }
    // post-processing: filter out the results
    List<Node> resultNodes = new ArrayList<>();
    int index = 0;
    for (Node node : selectedNodes) {
      boolean match = filter(selectedNodes, node, cssSelector, index);
      if (match) {
        resultNodes.add(node);
      }
      index++;
    }
    // continue with results
    nodes = resultNodes;
  }
  return nodes;
}
origin: fivesmallq/web-data-extractor

protected List<Node> select(Node rootNode, List<CssSelector> selectors) {
  // start with the root node
  List<Node> nodes = new ArrayList<>();
  nodes.add(rootNode);
  // iterate all selectors
  for (CssSelector cssSelector : selectors) {
    // create new set of results for current css selector
    List<Node> selectedNodes = new ArrayList<>();
    for (Node node : nodes) {
      walk(node, cssSelector, selectedNodes);
    }
    // post-processing: filter out the results
    List<Node> resultNodes = new ArrayList<>();
    int index = 0;
    for (Node node : selectedNodes) {
      boolean match = filter(selectedNodes, node, cssSelector, index);
      if (match == true) {
        resultNodes.add(node);
      }
      index++;
    }
    // continue with results
    nodes = resultNodes;
  }
  return nodes;
}
origin: org.jodd/jodd-lagarto

protected List<Node> select(final Node rootNode, final List<CssSelector> selectors) {
  // start with the root node
  List<Node> nodes = new ArrayList<>();
  nodes.add(rootNode);
  // iterate all selectors
  for (CssSelector cssSelector : selectors) {
    // create new set of results for current css selector
    List<Node> selectedNodes = new ArrayList<>();
    for (Node node : nodes) {
      walk(node, cssSelector, selectedNodes);
    }
    // post-processing: filter out the results
    List<Node> resultNodes = new ArrayList<>();
    int index = 0;
    for (Node node : selectedNodes) {
      boolean match = filter(selectedNodes, node, cssSelector, index);
      if (match) {
        resultNodes.add(node);
      }
      index++;
    }
    // continue with results
    nodes = resultNodes;
  }
  return nodes;
}
origin: org.jodd/jodd-wot

protected LinkedList<Node> select(Node rootNode, List<CssSelector> selectors) {
  // start with the root node
  LinkedList<Node> nodes = new LinkedList<Node>();
  nodes.add(rootNode);
  // iterate all selectors
  for (CssSelector cssSelector : selectors) {
    // create new set of results for current css selector
    LinkedList<Node> selectedNodes = new LinkedList<Node>();
    for (Node node : nodes) {
      walk(node, cssSelector, selectedNodes);
    }
    // post-processing: filter out the results
    LinkedList<Node> resultNodes = new LinkedList<Node>();
    int index = 0;
    for (Node node : selectedNodes) {
      boolean match = filter(selectedNodes, node, cssSelector, index);
      if (match == true) {
        resultNodes.add(node);
      }
      index++;
    }
    // continue with results
    nodes = resultNodes;
  }
  return nodes;
}
jodd.lagarto.domNodeSelectorfilter

Javadoc

Filter nodes.

Popular methods of NodeSelector

  • <init>
  • select
    Selects nodes using NodeFilter.
  • selectAndAdd
    Selects single node for single selector and appends it to the results.
  • walk
  • walkDescendantsIteratively
    Walks over the child notes, maintaining the tree order and not using recursion.
  • processSelectors
    Process selectors and keep adding results.
  • createCSSelly
    Creates CSSelly instance for parsing files.
  • selectFirst
    Selects nodes using NodeFilter and return the very first one.

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Notification (javax.management)
  • JFrame (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now