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