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.TagNodesInclusive.TNRemoveIncl; 009import Torello.Java.LV; 010 011/** 012 * Finds {@link TagNode} matches, and removes them with exactly the same means as class 013 * {@link TagNodeRemove} but, additionally, finds the corresponding matching 014 * Closing-{@code TagNode} and continues by removing that node, as well as every node situated 015 * between the two. 016 * 017 * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=TagNodeRemoveInclusive> 018 */ 019@Torello.JavaDoc.JDHeaderBackgroundImg 020@Torello.JavaDoc.StaticFunctional 021public class TagNodeRemoveInclusive 022{ 023 private TagNodeRemoveInclusive() { } 024 025 public static int first (Vector<? extends HTMLNode> html, String... htmlTags) 026 { return TNRemoveIncl.nth (html, 1, new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 027 028 public static int last (Vector<? extends HTMLNode> html, String... htmlTags) 029 { return TNRemoveIncl.nthFromEnd (html, 1, new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 030 031 public static int all (Vector<? extends HTMLNode> html, String... htmlTags) 032 { return TNRemoveIncl.all (html, new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 033 034 public static int allExcept (Vector<? extends HTMLNode> html, String... htmlTags) 035 { return TNRemoveIncl.allExcept (html, new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 036 037 public static int first (Vector<? extends HTMLNode> html, int sPos, int ePos, String... htmlTags) 038 { return TNRemoveIncl.nth (html, 1, new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 039 040 public static int last (Vector<? extends HTMLNode> html, int sPos, int ePos, String... htmlTags) 041 { return TNRemoveIncl.nthFromEnd (html, 1, new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 042 043 public static int all (Vector<? extends HTMLNode> html, int sPos, int ePos, String... htmlTags) 044 { return TNRemoveIncl.all (html, new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 045 046 public static int allExcept (Vector<? extends HTMLNode> html, int sPos, int ePos, String... htmlTags) 047 { return TNRemoveIncl.allExcept (html, new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 048 049 public static int nth (Vector<? extends HTMLNode> html, int nth, String... htmlTags) 050 { return TNRemoveIncl.nth (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 051 052 public static int nthFromEnd (Vector<? extends HTMLNode> html, int nth, String... htmlTags) 053 { return TNRemoveIncl.nthFromEnd (html, ARGCHECK.n(nth, html), new LV(html, 0, -1), ARGCHECK.htmlTags(htmlTags)); } 054 055 public static int nth (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, String... htmlTags) 056 { return TNRemoveIncl.nth (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 057 058 public static int nthFromEnd (Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, String... htmlTags) 059 { return TNRemoveIncl.nthFromEnd (html, ARGCHECK.n(nth, html), new LV(html, sPos, ePos), ARGCHECK.htmlTags(htmlTags)); } 060}