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 | package Torello.HTML.NodeSearch; import java.util.Vector; import java.util.regex.Pattern; import java.util.function.Predicate; import Torello.HTML.*; import Torello.HTML.NodeSearch.searchLoops.CommentNodes.CmtNCount; import Torello.Java.LV; /** * Counts HTML Comments which match a user-specified criteria, such as a * {@code String-Predicate}, Regular-Expression or {@link TextComparitor}. * * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=CommentNodeCount> */ @Torello.JavaDoc.JDHeaderBackgroundImg @Torello.JavaDoc.StaticFunctional public class CommentNodeCount { private CommentNodeCount() { } // **** all: no sPos, ePos public static int all (Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr) { return CmtNCount.all (html, new LV(html, 0, -1), ARGCHECK.TC(tc, compareStr)); } public static int all (Vector<? extends HTMLNode> html, Pattern p) { return CmtNCount.all (html, new LV(html, 0, -1), ARGCHECK.REGEX(p)); } public static int all (Vector<? extends HTMLNode> html, Predicate<String> p) { return CmtNCount.all (html, new LV(html, 0, -1), p); } // **** all: CRITERIA INCLUDES sPos, ePos public static int all (Vector<? extends HTMLNode> html, int sPos, int ePos, TextComparitor tc, String... compareStr) { return CmtNCount.all (html, new LV(html, sPos, ePos), ARGCHECK.TC(tc, compareStr)); } public static int all (Vector<? extends HTMLNode> html, int sPos, int ePos, Pattern p) { return CmtNCount.all (html, new LV(html, sPos, ePos), ARGCHECK.REGEX(p)); } public static int all (Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<String> p) { return CmtNCount.all (html, new LV(html, sPos, ePos), p); } // **** all: no sPos, ePos public static int allExcept (Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr) { return CmtNCount.allExcept (html, new LV(html, 0, -1), ARGCHECK.TC(tc, compareStr)); } public static int allExcept (Vector<? extends HTMLNode> html, Pattern p) { return CmtNCount.allExcept (html, new LV(html, 0, -1), ARGCHECK.REGEX(p)); } public static int allExcept (Vector<? extends HTMLNode> html, Predicate<String> p) { return CmtNCount.allExcept (html, new LV(html, 0, -1), p); } // **** all: CRITERIA INCLUDES sPos, ePos public static int allExcept (Vector<? extends HTMLNode> html, int sPos, int ePos, TextComparitor tc, String... compareStr) { return CmtNCount.allExcept (html, new LV(html, sPos, ePos), ARGCHECK.TC(tc, compareStr)); } public static int allExcept (Vector<? extends HTMLNode> html, int sPos, int ePos, Pattern p) { return CmtNCount.allExcept (html, new LV(html, sPos, ePos), ARGCHECK.REGEX(p)); } public static int allExcept (Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<String> p) { return CmtNCount.allExcept (html, new LV(html, sPos, ePos), p); } } |