001package Torello.HTML.NodeSearch; 002 003import java.util.Vector; 004import java.util.function.Predicate; 005import java.util.regex.Pattern; 006 007import Torello.HTML.*; 008import Torello.Java.LV; 009 010/** 011 * {@code Static} methods for building and instantiating an 012 * {@link HNLI}<CODE><</CODE>{@link CommentNode}<CODE>></CODE> (which extends the basic 013 * iterator class) for iterating the comments inside of an HTML-{@code Vector}, with the help of a 014 * user-provided {@code String-Predicate}, Regular Expression or {@link TextComparitor} as a 015 * search-specifier. 016 * 017 * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=CommentNodeIterator> 018 */ 019@Torello.JavaDoc.JDHeaderBackgroundImg 020@Torello.JavaDoc.StaticFunctional 021public class CommentNodeIterator 022{ 023 private CommentNodeIterator() { } 024 025 public static HNLI<CommentNode> iterator (Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr) 026 { return new HNLI<CommentNode> (html, ARGCHECK.TC_CNP(tc, compareStr), CommentNode.class); } 027 028 public static HNLI<CommentNode> iterator (Vector<? extends HTMLNode> html, Pattern p) 029 { return new HNLI<CommentNode> (html, ARGCHECK.REGEX_CNP(p), CommentNode.class); } 030 031 public static HNLI<CommentNode> iterator (Vector<? extends HTMLNode> html, Predicate<String> p) 032 { return new HNLI<CommentNode> (html, ARGCHECK.SP_TO_CNP(p), CommentNode.class); } 033 034 public static HNLI<CommentNode> exceptIterator (Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr) 035 { return new HNLI<CommentNode> (html, ARGCHECK.TC_CNP(tc, compareStr).negate(), CommentNode.class); } 036 037 public static HNLI<CommentNode> exceptIterator (Vector<? extends HTMLNode> html, Pattern p) 038 { return new HNLI<CommentNode> (html, ARGCHECK.REGEX_CNP(p).negate(), CommentNode.class); } 039 040 public static HNLI<CommentNode> exceptIterator (Vector<? extends HTMLNode> html, Predicate<String> p) 041 { return new HNLI<CommentNode> (html, ARGCHECK.SP_TO_CNP(p).negate(), CommentNode.class); } 042 043}