001package Torello.HTML.NodeSearch; 002 003import java.util.Vector; 004import java.util.regex.Pattern; 005import java.util.function.Predicate; 006 007import Torello.HTML.*; 008import Torello.HTML.NodeSearch.SearchLoops.TagNodesInclusive.TNPollIncl; 009import Torello.Java.LV; 010 011/** 012 * Searches for {@link TagNode} matches, using exactly the same criteria offered by class 013 * {@link TagNodePoll}, but also obtains the corresponding Closing-Tags from the 014 * input-{@code Vector} and, subsequently, <B><I>extracts</I></B> these sublists from the 015 * input-{@code Vector} and then <B><I>returns</I></B> the sublists as new instances of 016 * {@code Vector<HTMLNode>}. 017 * 018 * <EMBED CLASS='external-html' DATA-FILE-ID=TagNodePollInclusive> 019 */ 020@Torello.JavaDoc.JDHeaderBackgroundImg 021@Torello.JavaDoc.StaticFunctional 022public class TagNodePollInclusive 023{ 024 private TagNodePollInclusive() { } 025 026 public static Vector<HTMLNode> first (Vector<? extends HTMLNode> html, String... htmlTags) 027 { return TNPollIncl.nth (html, 1, new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 028 029 public static Vector<HTMLNode> last (Vector<? extends HTMLNode> html, String... htmlTags) 030 { return TNPollIncl.nthFromEnd (html, 1, new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 031 032 public static Vector<Vector<HTMLNode>> all (Vector<? extends HTMLNode> html, String... htmlTags) 033 { return TNPollIncl.all (html, new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 034 035 public static Vector<Vector<HTMLNode>> allExcept (Vector<? extends HTMLNode> html, String... htmlTags) 036 { return TNPollIncl.allExcept (html, new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 037 038 public static Vector<HTMLNode> first (Vector<? extends HTMLNode> html, int sPos, int ePos, String... htmlTags) 039 { return TNPollIncl.nth (html, 1, new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 040 041 public static Vector<HTMLNode> last (Vector<? extends HTMLNode> html, int sPos, int ePos, String... htmlTags) 042 { return TNPollIncl.nthFromEnd (html, 1, new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 043 044 public static Vector<Vector<HTMLNode>> all (Vector<? extends HTMLNode> html, int sPos, int ePos, String... htmlTags) 045 { return TNPollIncl.all (html, new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 046 047 public static Vector<Vector<HTMLNode>> allExcept (Vector<? extends HTMLNode> html, int sPos, int ePos, String... htmlTags) 048 { return TNPollIncl.allExcept (html, new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 049 050 public static Vector<HTMLNode> nth (Vector<? extends HTMLNode> html, int nth, String... htmlTags) 051 { return TNPollIncl.nth (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 052 053 public static Vector<HTMLNode> nthFromEnd (Vector<? extends HTMLNode> html, int nth, String... htmlTags) 054 { return TNPollIncl.nthFromEnd (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 055 056 public static Vector<HTMLNode> nth (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, String... htmlTags) 057 { return TNPollIncl.nth (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 058 059 public static Vector<HTMLNode> nthFromEnd (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, String... htmlTags) 060 { return TNPollIncl.nthFromEnd (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 061 062}