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.CmtNRemove;
009import Torello.Java.LV;
010
011/**
012 * <CODE>CommentNode Remove - Documentation.</CODE><BR /><BR />
013 * <EMBED CLASS="external-html" DATA-FILE-ID="CNR"> 
014 */
015@Torello.HTML.Tools.JavaDoc.StaticFunctional
016public class CommentNodeRemove
017{
018    private CommentNodeRemove() { }
019
020    // ********************************************************************************************
021    // FIRST, LAST
022    // ********************************************************************************************
023
024    // **** first: no sPos, ePos 
025    public static int first (Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr)
026    { return CmtNRemove.nth (html, 1, new LV(html, 0, -1), ARGCHECK.TC(tc, compareStr)); }
027    public static int first (Vector<? extends HTMLNode> html, Pattern p)
028    { return CmtNRemove.nth (html, 1, new LV(html, 0, -1), ARGCHECK.REGEX(p)); }
029    public static int first (Vector<? extends HTMLNode> html, Predicate<String> p)
030    { return CmtNRemove.nth (html, 1, new LV(html, 0, -1), p); }
031
032    // **** first: CRITERIA INCLUDES sPos, ePos
033    public static int first (Vector<? extends HTMLNode> html, int sPos, int ePos, TextComparitor tc, String... compareStr)
034    { return CmtNRemove.nth (html, 1, new LV(html, sPos, ePos), ARGCHECK.TC(tc, compareStr)); }
035    public static int first (Vector<? extends HTMLNode> html, int sPos, int ePos, Pattern p)
036    { return CmtNRemove.nth (html, 1, new LV(html, sPos, ePos), ARGCHECK.REGEX(p)); }
037    public static int first (Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<String> p)
038    { return CmtNRemove.nth (html, 1, new LV(html, sPos, ePos), p); }
039
040    // **** last: no sPos, ePos
041    public static int last (Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr)
042    { return CmtNRemove.nthFromEnd (html, 1, new LV(html, 0, -1), ARGCHECK.TC(tc, compareStr)); }
043    public static int last (Vector<? extends HTMLNode> html, Pattern p)
044    { return CmtNRemove.nthFromEnd (html, 1, new LV(html, 0, -1), ARGCHECK.REGEX(p)); }
045    public static int last (Vector<? extends HTMLNode> html, Predicate<String> p)
046    { return CmtNRemove.nthFromEnd (html, 1, new LV(html, 0, -1), p); }
047
048    // **** last: CRITERIA INCLUDES sPos, ePos
049    public static int last (Vector<? extends HTMLNode> html, int sPos, int ePos, TextComparitor tc, String... compareStr)
050    { return CmtNRemove.nthFromEnd (html, 1, new LV(html, sPos, ePos), ARGCHECK.TC(tc, compareStr)); }
051    public static int last (Vector<? extends HTMLNode> html, int sPos, int ePos, Pattern p)
052    { return CmtNRemove.nthFromEnd (html, 1, new LV(html, sPos, ePos), ARGCHECK.REGEX(p)); }
053    public static int last (Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<String> p)
054    { return CmtNRemove.nthFromEnd (html, 1, new LV(html, sPos, ePos), p); }
055
056    // ********************************************************************************************
057    // NEW ADDITIONS: nth and nthFromEnd
058    // ********************************************************************************************
059
060    // **** first: no sPos, ePos 
061    public static int nth (Vector<? extends HTMLNode> html, int nth, TextComparitor tc, String... compareStr)
062    { return CmtNRemove.nth (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), ARGCHECK.TC(tc, compareStr)); }
063    public static int nth (Vector<? extends HTMLNode> html, int nth, Pattern p)
064    { return CmtNRemove.nth (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), ARGCHECK.REGEX(p)); }
065    public static int nth (Vector<? extends HTMLNode> html, int nth, Predicate<String> p)
066    { return CmtNRemove.nth (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), p); }
067
068    // **** first: CRITERIA INCLUDES sPos, ePos
069    public static int nth (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, TextComparitor tc, String... compareStr)
070    { return CmtNRemove.nth (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), ARGCHECK.TC(tc, compareStr)); }
071    public static int nth (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, Pattern p)
072    { return CmtNRemove.nth (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), ARGCHECK.REGEX(p)); }
073    public static int nth (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, Predicate<String> p)
074    { return CmtNRemove.nth (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), p); }
075
076    // **** last: no sPos, ePos
077    public static int nthFromEnd (Vector<? extends HTMLNode> html, int nth, TextComparitor tc, String... compareStr)
078    { return CmtNRemove.nthFromEnd (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), ARGCHECK.TC(tc, compareStr)); }
079    public static int nthFromEnd (Vector<? extends HTMLNode> html, int nth, Pattern p)
080    { return CmtNRemove.nthFromEnd (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), ARGCHECK.REGEX(p)); }
081    public static int nthFromEnd (Vector<? extends HTMLNode> html, int nth, Predicate<String> p)
082    { return CmtNRemove.nthFromEnd (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), p); }
083
084    // **** last: CRITERIA INCLUDES sPos, ePos
085    public static int nthFromEnd (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, TextComparitor tc, String... compareStr)
086    { return CmtNRemove.nthFromEnd (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), ARGCHECK.TC(tc, compareStr)); }
087    public static int nthFromEnd (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, Pattern p)
088    { return CmtNRemove.nthFromEnd (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), ARGCHECK.REGEX(p)); }
089    public static int nthFromEnd (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, Predicate<String> p)
090    { return CmtNRemove.nthFromEnd (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), p); }
091
092    // ********************************************************************************************
093    // ALL Methods
094    // ********************************************************************************************
095
096    // **** all: no sPos, ePos
097    public static int all (Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr)
098    { return CmtNRemove.all (html, new LV(html, 0, -1), ARGCHECK.TC(tc, compareStr)); }
099    public static int all (Vector<? extends HTMLNode> html, Pattern p)
100    { return CmtNRemove.all (html, new LV(html, 0, -1), ARGCHECK.REGEX(p)); }
101    public static int all (Vector<? extends HTMLNode> html, Predicate<String> p)
102    { return CmtNRemove.all (html, new LV(html, 0, -1), p); }
103
104    // **** all: CRITERIA INCLUDES sPos, ePos
105    public static int all (Vector<? extends HTMLNode> html, int sPos, int ePos, TextComparitor tc, String... compareStr)
106    { return CmtNRemove.all (html, new LV(html, sPos, ePos), ARGCHECK.TC(tc, compareStr)); }
107    public static int all (Vector<? extends HTMLNode> html, int sPos, int ePos, Pattern p)
108    { return CmtNRemove.all (html, new LV(html, sPos, ePos), ARGCHECK.REGEX(p)); }
109    public static int all (Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<String> p)
110    { return CmtNRemove.all (html, new LV(html, sPos, ePos), p); }
111
112
113    // **** allExcept: no sPos, ePos
114    public static int allExcept (Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr)
115    { return CmtNRemove.allExcept (html, new LV(html, 0, -1), ARGCHECK.TC(tc, compareStr)); }
116    public static int allExcept (Vector<? extends HTMLNode> html, Pattern p)
117    { return CmtNRemove.allExcept (html, new LV(html, 0, -1), ARGCHECK.REGEX(p)); }
118    public static int allExcept (Vector<? extends HTMLNode> html, Predicate<String> p)
119    { return CmtNRemove.allExcept (html, new LV(html, 0, -1), p); }
120
121    // **** allExcept: CRITERIA INCLUDES sPos, ePos
122    public static int allExcept (Vector<? extends HTMLNode> html, int sPos, int ePos, TextComparitor tc, String... compareStr)
123    { return CmtNRemove.allExcept (html, new LV(html, sPos, ePos), ARGCHECK.TC(tc, compareStr)); }
124    public static int allExcept (Vector<? extends HTMLNode> html, int sPos, int ePos, Pattern p)
125    { return CmtNRemove.allExcept (html, new LV(html, sPos, ePos), ARGCHECK.REGEX(p)); }
126    public static int allExcept (Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<String> p)
127    { return CmtNRemove.allExcept (html, new LV(html, sPos, ePos), p); }
128}