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 | package Torello.HTML.NodeSearch; import java.util.Vector; import java.util.function.Predicate; import java.util.regex.Pattern; import Torello.HTML.*; import Torello.Java.LV; /** * {@code Static} methods for building and instantiating an * {@link HNLI}<CODE><</CODE>{@link TextNode}<CODE>></CODE> (which extends the basic * iterator class) for iterating the text inside of an HTML-{@code Vector}, with the help of a * user-provided {@code String-Predicate}, Regular Expression or {@link TextComparitor} as a * search specifier. * * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=TextNodeIterator> */ @Torello.JavaDoc.JDHeaderBackgroundImg @Torello.JavaDoc.StaticFunctional public class TextNodeIterator { private TextNodeIterator() { } public static HNLI<TextNode> iterator (Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr) { return new HNLI<TextNode> (html, ARGCHECK.TC_TXNP(tc, compareStr), TextNode.class); } public static HNLI<TextNode> iterator (Vector<? extends HTMLNode> html, Pattern p) { return new HNLI<TextNode> (html, ARGCHECK.REGEX_TXNP(p), TextNode.class); } public static HNLI<TextNode> iterator (Vector<? extends HTMLNode> html, Predicate<String> p) { return new HNLI<TextNode> (html, ARGCHECK.SP_TO_TXNP(p), TextNode.class); } public static HNLI<TextNode> exceptIterator (Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr) { return new HNLI<TextNode> (html, ARGCHECK.TC_TXNP(tc, compareStr).negate(), TextNode.class); } public static HNLI<TextNode> exceptIterator (Vector<? extends HTMLNode> html, Pattern p) { return new HNLI<TextNode> (html, ARGCHECK.REGEX_TXNP(p).negate(), TextNode.class); } public static HNLI<TextNode> exceptIterator (Vector<? extends HTMLNode> html, Predicate<String> p) { return new HNLI<TextNode> (html, ARGCHECK.SP_TO_TXNP(p).negate(), TextNode.class); } } |