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.ITCount;
009import Torello.Java.LV;
010
011/**
012 * <CODE>InnerTag Count - Documentation.</CODE><BR /><BR />
013 * <EMBED CLASS="external-html" DATA-FILE-ID="ITC"> 
014 */
015@Torello.HTML.Tools.JavaDoc.StaticFunctional
016public class InnerTagCount
017{
018    private InnerTagCount() { }
019
020    // **** Find-First, CRITERIA: htmlTag, sPos, ePos
021    public static int all(Vector<? extends HTMLNode> html, int sPos, int ePos, String htmlTag, String innerTag)
022    { return ITCount.ALL(html, new LV(html, sPos, ePos), ARGCHECK.htmlTag(htmlTag), ARGCHECK.innerTag(innerTag), ARGCHECK.TRUE); }
023
024    public static int all(Vector<? extends HTMLNode> html, int sPos, int ePos, String htmlTag, String innerTag, TextComparitor tc, String... compareStr)
025    { return ITCount.ALL(html, new LV(html, sPos, ePos), ARGCHECK.htmlTag(htmlTag), ARGCHECK.innerTag(innerTag), ARGCHECK.TC(tc, compareStr)); }
026
027    public static int all(Vector<? extends HTMLNode> html, int sPos, int ePos, String htmlTag, String innerTag, Pattern p)
028    { return ITCount.ALL(html, new LV(html, sPos, ePos), ARGCHECK.htmlTag(htmlTag), ARGCHECK.innerTag(innerTag), ARGCHECK.REGEX(p)); }
029
030    public static int all(Vector<? extends HTMLNode> html, int sPos, int ePos, String htmlTag, String innerTag, Predicate<String> attributeValuePred)
031    { return ITCount.ALL(html, new LV(html, sPos, ePos), ARGCHECK.htmlTag(htmlTag), ARGCHECK.innerTag(innerTag), attributeValuePred); }
032
033    public static int all(Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<TagNode> p, String... htmlTags)
034    { return ITCount.ALL(html, new LV(html, sPos, ePos), p, ARGCHECK.htmlTags(htmlTags)); }
035
036
037    // **** Find-All, CRITERIA: htmlTag
038    public static int all(Vector<? extends HTMLNode> html, String htmlTag, String innerTag)
039    { return ITCount.ALL(html, new LV(html, 0, -1), ARGCHECK.htmlTag(htmlTag), ARGCHECK.innerTag(innerTag), ARGCHECK.TRUE); }
040
041    public static int all(Vector<? extends HTMLNode> html, String htmlTag, String innerTag, TextComparitor tc, String... compareStr)
042    { return ITCount.ALL(html, new LV(html, 0, -1), ARGCHECK.htmlTag(htmlTag), ARGCHECK.innerTag(innerTag), ARGCHECK.TC(tc, compareStr)); }
043
044    public static int all(Vector<? extends HTMLNode> html, String htmlTag, String innerTag, Pattern p)
045    { return ITCount.ALL(html, new LV(html, 0, -1), ARGCHECK.htmlTag(htmlTag), ARGCHECK.innerTag(innerTag), ARGCHECK.REGEX(p)); }
046
047    public static int all(Vector<? extends HTMLNode> html, String htmlTag, String innerTag, Predicate<String> attributeValuePred)
048    { return ITCount.ALL(html, new LV(html, 0, -1), ARGCHECK.htmlTag(htmlTag), ARGCHECK.innerTag(innerTag), attributeValuePred); }
049
050    public static int all(Vector<? extends HTMLNode> html, Predicate<TagNode> p, String... htmlTags)
051    { return ITCount.ALL(html, new LV(html, 0, -1), p, ARGCHECK.htmlTags(htmlTags)); }
052
053
054    // **** Find-First, CRITERIA: sPos, ePos
055    public static int all(Vector<? extends HTMLNode> html, int sPos, int ePos, String innerTag)
056    { return ITCount.ALL(html, new LV(html, sPos, ePos), null, ARGCHECK.innerTag(innerTag), ARGCHECK.TRUE); }
057
058    public static int all(Vector<? extends HTMLNode> html, int sPos, int ePos, String innerTag, TextComparitor tc, String... compareStr)
059    { return ITCount.ALL(html, new LV(html, sPos, ePos), null, ARGCHECK.innerTag(innerTag), ARGCHECK.TC(tc, compareStr)); }
060
061    public static int all(Vector<? extends HTMLNode> html, int sPos, int ePos, String innerTag, Pattern p)
062    { return ITCount.ALL(html, new LV(html, sPos, ePos), null, ARGCHECK.innerTag(innerTag), ARGCHECK.REGEX(p)); }
063
064    public static int all(Vector<? extends HTMLNode> html, int sPos, int ePos, String innerTag, Predicate<String> attributeValuePred)
065    { return ITCount.ALL(html, new LV(html, sPos, ePos), null, ARGCHECK.innerTag(innerTag), attributeValuePred); }
066
067    public static int all(Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<TagNode> p)
068    { return ITCount.ALL(html, new LV(html, sPos, ePos), p); }
069
070
071    // **** Find-All, ALL-CRITERIA-NULL
072    public static int all(Vector<? extends HTMLNode> html, String innerTag)
073    { return ITCount.ALL(html, new LV(html, 0, -1), null, ARGCHECK.innerTag(innerTag), ARGCHECK.TRUE); }
074
075    public static int all(Vector<? extends HTMLNode> html, String innerTag, TextComparitor tc, String... compareStr)
076    { return ITCount.ALL(html, new LV(html, 0, -1), null, ARGCHECK.innerTag(innerTag), ARGCHECK.TC(tc, compareStr)); }
077
078    public static int all(Vector<? extends HTMLNode> html, String innerTag, Pattern p)
079    { return ITCount.ALL(html, new LV(html, 0, -1), null, ARGCHECK.innerTag(innerTag), ARGCHECK.REGEX(p)); }
080
081    public static int all(Vector<? extends HTMLNode> html, String innerTag, Predicate<String> attributeValuePred)
082    { return ITCount.ALL(html, new LV(html, 0, -1), null, ARGCHECK.innerTag(innerTag), attributeValuePred); }
083
084    public static int all(Vector<? extends HTMLNode> html, Predicate<TagNode> p)
085    { return ITCount.ALL(html, new LV(html, 0, -1), p); }
086}