1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package Torello.HTML.NodeSearch;

import java.util.*;
import java.util.regex.Pattern;
import java.util.function.Predicate;

import Torello.HTML.*;
import Torello.HTML.NodeSearch.searchLoops.TNGet;
import Torello.Java.LV;

/**
 * Searches an HTML-Vector for HTML-Tag matches based on Tag-Name and whether or not the Tag
 * is an Opening-Tag, and then returns those matches as instances of {@link TagNode}.
 * 
 * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=TagNodeGet>
 */
@Torello.JavaDoc.JDHeaderBackgroundImg
@Torello.JavaDoc.StaticFunctional
public class TagNodeGet
{
    private TagNodeGet() { }

    public static TagNode first             (Vector<? extends HTMLNode> html, TC tagCriteria, String... htmlTags)
    { return TNGet.nth                      (html, 1, new LV(html, 0, -1), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

    public static TagNode last              (Vector<? extends HTMLNode> html, TC tagCriteria, String... htmlTags)
    { return TNGet.nthFromEnd               (html, 1, new LV(html, 0, -1), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

    public static Vector<TagNode> all       (Vector<? extends HTMLNode> html, TC tagCriteria, String... htmlTags)
    { return TNGet.all                      (html, new LV(html, 0, -1), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

    public static Vector<TagNode> allExcept (Vector<? extends HTMLNode> html, TC tagCriteria, String... htmlTags)
    { return TNGet.allExcept                (html, new LV(html, 0, -1), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

    public static TagNode first             (Vector<? extends HTMLNode> html, int sPos, int ePos, TC tagCriteria, String... htmlTags)
    { return TNGet.nth                      (html, 1, new LV(html, sPos, ePos), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

    public static TagNode last              (Vector<? extends HTMLNode> html, int sPos, int ePos, TC tagCriteria, String... htmlTags)
    { return TNGet.nthFromEnd               (html, 1, new LV(html, sPos, ePos), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

    public static Vector<TagNode> all       (Vector<? extends HTMLNode> html, int sPos, int ePos, TC tagCriteria, String... htmlTags)
    { return TNGet.all                      (html, new LV(html, sPos, ePos), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

    public static Vector<TagNode> allExcept (Vector<? extends HTMLNode> html, int sPos, int ePos, TC tagCriteria, String... htmlTags)
    { return TNGet.allExcept                (html, new LV(html, sPos, ePos), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

    public static TagNode nth               (Vector<? extends HTMLNode> html, int nth, TC tagCriteria, String... htmlTags)
    { return TNGet.nth                      (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

    public static TagNode nthFromEnd        (Vector<? extends HTMLNode> html, int nth, TC tagCriteria, String... htmlTags)
    { return TNGet.nthFromEnd               (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

    public static TagNode nth               (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, TC tagCriteria, String... htmlTags)
    { return TNGet.nth                      (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

    public static TagNode nthFromEnd        (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, TC tagCriteria, String... htmlTags)
    { return TNGet.nthFromEnd               (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), tagCriteria, ARGCHECK.htmlTags(htmlTags)); }

}