001package Torello.HTML.NodeSearch; 002 003import Torello.Java.*; 004 005import java.lang.reflect.Field; 006import java.util.function.BiPredicate; 007 008/** 009 * A functional-interface / lambda-target that has many pre-instantiated instances that 010 * essentially serves a simplified wrappers for the many {@code String} search and comparison 011 * utilities provided in <CODE>Torello.Java</CODE>. 012 * 013 * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=TextComparitor> 014 */ 015@FunctionalInterface 016public interface TextComparitor extends BiPredicate<String, String[]>, java.io.Serializable 017{ 018 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDFI> */ 019 public static final long serialVersionUID = 1; 020 021 /** 022 * <EMBED CLASS='external-html' DATA-FILE-ID=FUNC_INTER_METH> 023 * 024 * @param str This is usually a line of text from the {@code public final String str} field of 025 * the class {@code TextNode}, if the programmer is requesting a {@code TextNode} search. If 026 * the search being performed is on {@code TagNode} attribute values, then the value of 027 * parameter {@code String htmlText} will be any {@code String}-text within an HTML Element's 028 * attribute <B STYLE="color: red;">value</B>. 029 * 030 * @param compareText This is a list of different text-{@code String's} to be used by the 031 * method that performs the test. View the compare-{@code String's} in the methods of classes 032 * {@link StrCmpr} or {@link StrTokCmpr} to understand this more clearly. 033 * 034 * @return After performing the single-input-parameter "version of" the 035 * {@code accept(htmlText, compareText)} method on as many of the elements of the 036 * {@code String[] compareText} input-array, this will return {@code TRUE} or {@code FALSE} 037 * dependent on the expected boolean-logic behavior of the comparison. This is simple, as the 038 * four primary {@code boolean} operations: {@code AND, OR, NAND, XOR} are provided as 039 * pre-defined methods here. 040 * 041 * <BR /><BR /><B>NOTE: </B>All boolean evaluations done are <I>short-circuit evaluations</I>. 042 * As soon as a function result-value is known, it will be returned. 043 * <BR /><B>ALSO: </B>Loops begin with the first element of the {@code String[] compareText} 044 * array, and stop with the last element. 045 */ 046 public boolean test(String str, String[] compareText); 047 048 // *************************************************************************************************** 049 // Specialized CSS Class Testers. 050 // *************************************************************************************************** 051 052 /** 053 * This will check that <I><B>at least one of</I></B> the named/provided 054 * "Compare-{@code String's}" are present, as tokens not substrings, in the 055 * CSS-Class-{@code String} of an HTML Element. 056 * 057 * <EMBED CLASS='external-html' DATA-FILE-ID=TCCSSTOK> 058 * 059 * @see StrTokCmpr#containsOR(String, String[]) 060 */ 061 public static final TextComparitor CONTAINS_CSS_CLASS_OR = StrTokCmpr::containsOR; 062 063 /** 064 * This will check that <I><B>all / every-one-of</I></B> the named/provided 065 * "Compare-{@code String's}" are present, as tokens not substrings, in the 066 * CSS-Class-{@code String} of an HTML Element. 067 * 068 * <EMBED CLASS='external-html' DATA-FILE-ID=TCCSSTOK> 069 * 070 * @see StrTokCmpr#containsAND(String, String[]) 071 */ 072 public static final TextComparitor CONTAINS_CSS_CLASS_AND = StrTokCmpr::containsAND; 073 074 /** 075 * This will check that <I><B>none of</I></B> the named/provided "Compare-{@code String's}" are 076 * present, as tokens not substrings, in the CSS-Class-{@code String} of an HTML Element. 077 * 078 * <EMBED CLASS='external-html' DATA-FILE-ID=TCCSSTOK> 079 * 080 * @see StrTokCmpr#containsNAND(String, String[]) 081 */ 082 public static final TextComparitor CONTAINS_CSS_CLASS_NAND = StrTokCmpr::containsNAND; 083 084 /** 085 * This will check that <I><B>exactly one of</I></B> the named/provided 086 * "Compare-{@code String's}" are present, as tokens not substrings, in the 087 * CSS-Class-{@code String} of an HTML Element. 088 * 089 * <EMBED CLASS='external-html' DATA-FILE-ID=TCCSSTOK> 090 * 091 * @see StrTokCmpr#containsXOR(String, String[]) 092 */ 093 public static final TextComparitor CONTAINS_CSS_CLASS_XOR = StrTokCmpr::containsXOR; 094 095 /** 096 * This is used as an "abbreviation" to save typing (for convenience). It can reduce, however, 097 * readability. 098 * 099 * <BR /><BR /><B>STANDARD-CSS:</B> The standard way to look for HTML Element matches using a 100 * CSS-Selector is to use a boolean {@code 'or'}, not a boolean {@code 'and.'} 101 * 102 * <EMBED CLASS='external-html' DATA-FILE-ID=TCCSSTOK> 103 * 104 * @see #CONTAINS_CSS_CLASS_OR 105 */ 106 public static final TextComparitor C_OR = CONTAINS_CSS_CLASS_OR; 107 108 /** 109 * This is used as an "abbreviation" to save typing (for convenience). It can reduce, however, 110 * readability. Since this is Java, not a CSS-Style-Sheet, this "selector" 111 * ({@code java.util.function.BiPredicate}) allows the programmer the flexibility to build an 112 * "AND" CSS-Class-Selector, rather than an "OR" CSS-Class-Selector. 113 * 114 * <EMBED CLASS='external-html' DATA-FILE-ID=TCCSSTOK> 115 * 116 * @see #CONTAINS_CSS_CLASS_AND 117 */ 118 public static final TextComparitor C_AND = CONTAINS_CSS_CLASS_AND; 119 120 /** 121 * This is just used as an "abbreviation" to save typing (for convenience). It can reduce, 122 * however, readability. Since this is Java, not a CSS-Style-Sheet, this "selector" 123 * ({@code java.util.function.BiPredicate}) allows the programmer the flexibility to build a 124 * "NAND" CSS-Class-Selector, rather than an "OR" CSS-Class-Selector. 125 * 126 * <EMBED CLASS='external-html' DATA-FILE-ID=TCCSSTOK> 127 * 128 * @see #CONTAINS_CSS_CLASS_NAND 129 */ 130 public static final TextComparitor C_NAND = CONTAINS_CSS_CLASS_NAND; 131 132 /** 133 * This is just used as an "abbreviation" to save typing (for convenience). It can reduce, 134 * however, readability. Since this is Java, not a CSS-Style-Sheet, this "selector" 135 * ({@code java.util.function.BiPredicate}) allows the programmer the flexibility to build an 136 * "XOR" CSS-Class-Selector, rather than an "OR" CSS-Class-Selector. 137 * 138 * <EMBED CLASS='external-html' DATA-FILE-ID=TCCSSTOK> 139 * 140 * @see #CONTAINS_CSS_CLASS_XOR 141 */ 142 public static final TextComparitor C_XOR = CONTAINS_CSS_CLASS_XOR; 143 144 /** 145 * This is used as an <B>EXTRA</B> "abbreviation" to save typing (for convenience). It can 146 * reduce, however, readability. 147 * 148 * <BR /><BR /><B STYLE='color: red;'>STANDARD-CSS:</B> The standard way to look for HTML 149 * Element matches using a CSS-Selector is to use a boolean {@code 'or'}, not a boolean 150 * {@code 'and'}. 151 * 152 * <BR /><BR /><B STYLE='color: red;'>ALSO:</B> CSS Classes are <B><I>not</I></B> case 153 * insensitive. 154 * 155 * <EMBED CLASS='external-html' DATA-FILE-ID=TCCSSTOK> 156 * 157 * @see #C_OR 158 * @see #CONTAINS_CSS_CLASS_OR 159 */ 160 public static final TextComparitor C = C_OR; 161 162 // *************************************************************************************************** 163 // EQUALITY TESTING 164 // *************************************************************************************************** 165 166 /** 167 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 168 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 169 * If precisely one of the compare-{@code String's} equal the 170 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode}, then and only then will this 171 * {@code BiPredicate} return {@code TRUE}. 172 * 173 * @see StrCmpr#equalsXOR(String, String[]) 174 */ 175 public static final TextComparitor EQ = StrCmpr::equalsXOR; 176 177 /** 178 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 179 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 180 * If and only if none of the candidates are equal, can this {@code BiPredicate} evaluate to 181 * {@code TRUE}. 182 * 183 * @see StrCmpr#equalsNAND(String, String[]) 184 */ 185 public static final TextComparitor NOT_EQ = StrCmpr::equalsNAND; 186 187 /** 188 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 189 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 190 * If and only if none of the candidates are equal, can this {@code BiPredicate} evaluate to 191 * {@code TRUE}. This function-pointer is identical to the one named {@link #NOT_EQ}. 192 * 193 * @see StrCmpr#equalsNAND(String, String[]) 194 */ 195 public static final TextComparitor EQ_NAND = StrCmpr::equalsNAND; 196 197 /** 198 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 199 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 200 * If precisely one of the compare-{@code String's} equal the 201 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode}, then and only then will this 202 * {@code BiPredicate} return {@code TRUE}. In this function-pointer, the comparison performed 203 * will ignore the case of the arguments. 204 * 205 * @see StrCmpr#equalsXOR_CI(String, String[]) 206 */ 207 public static final TextComparitor EQ_CASE_INSENSITIVE = StrCmpr::equalsXOR_CI; 208 209 /** 210 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 211 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 212 * If precisely one of the compare-{@code String's} equal the 213 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode}, then and only then will this 214 * {@code BiPredicate} return {@code TRUE}. In this function-pointer, the comparison performed 215 * will ignore the case of the arguments. This is an abbreviated version of the identical 216 * {@code TextComparitor} {@link #EQ_CASE_INSENSITIVE}. 217 * 218 * @see StrCmpr#equalsXOR_CI(String, String[]) 219 */ 220 public static final TextComparitor EQ_CI = StrCmpr::equalsXOR_CI; 221 222 /** 223 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 224 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 225 * If and only if none of the candidates are equal, can this {@code BiPredicate} evaluate to 226 * {@code TRUE}. In this function-pointer, the comparison performed will ignore the case of the 227 * arguments. 228 * 229 * @see StrCmpr#equalsNAND_CI(String, String[]) 230 */ 231 public static final TextComparitor NOT_EQ_CASE_INSENSITIVE = StrCmpr::equalsNAND_CI; 232 233 /** 234 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 235 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 236 * If and only if none of the candidates are equal, can this {@code BiPredicate} evaluate to 237 * {@code TRUE}. In this function-pointer, the comparison performed will ignore the case of the 238 * arguments. This is an abbreviated version of the identical {@code TextComparitor} 239 * {@link #NOT_EQ_CASE_INSENSITIVE}. 240 * 241 * @see StrCmpr#equalsNAND_CI(String, String[]) 242 */ 243 public static final TextComparitor NOT_EQ_CI = StrCmpr::equalsNAND_CI; 244 245 /** 246 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 247 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 248 * If and only if none of the candidates are equal, can this {@code BiPredicate} evaluate to 249 * {@code TRUE}. In this function-pointer, the comparison performed will ignore the case of the 250 * arguments. This is an abbreviated version of the identical {@code TextComparitor} 251 * {@link #NOT_EQ_CASE_INSENSITIVE}. 252 * 253 * @see StrCmpr#equalsNAND_CI(String, String[]) 254 */ 255 public static final TextComparitor EQ_CI_NAND = StrCmpr::equalsNAND_CI; 256 257 // *************************************************************************************************** 258 // EQUALITY TESTING - WITH PRE TEXT CALL TO 'trim()' 259 // *************************************************************************************************** 260 261 /** 262 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 263 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 264 * If precisely one of the compare-{@code String's} equal the 265 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode}, then and only then will this 266 * {@code BiPredicate} return {@code TRUE}. Before the equality-comparison is performed, the 267 * {@code java.lang.String.trim()} method will be invoked on the 268 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode}. 269 * 270 * @see StrCmpr#equalsXOR(String, String[]) 271 */ 272 public static final TextComparitor EQ_TRM = 273 (String s, String[] sArr) -> StrCmpr.equalsXOR(s.trim(), sArr); 274 275 /** 276 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 277 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 278 * If and only if none of the candidates are equal, can this {@code BiPredicate} evaluate to 279 * {@code TRUE}. Before the equality-comparison is performed, the 280 * {@code java.lang.String.trim()} method will be invoked on the 281 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode}. 282 * 283 * @see StrCmpr#equalsNAND(String, String[]) 284 */ 285 public static final TextComparitor NOT_EQ_TRM = 286 (String s, String[] sArr) -> StrCmpr.equalsNAND(s.trim(), sArr); 287 288 /** 289 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 290 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 291 * If and only if none of the candidates are equal, can this {@code BiPredicate} evaluate to 292 * {@code TRUE}. This function-pointer is identical to the one named {@link #NOT_EQ}. Before 293 * the equality-comparison is performed, the {@code java.lang.String.trim()} method will be 294 * invoked on the attribute-<B STYLE="color: red;">value</B> or {@code TextNode}. 295 * 296 * @see StrCmpr#equalsNAND(String, String[]) */ 297 public static final TextComparitor EQ_NAND_TRM = 298 (String s, String[] sArr) -> StrCmpr.equalsNAND(s.trim(), sArr); 299 300 /** 301 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 302 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 303 * If precisely one of the compare-{@code String's} equal the 304 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode}, then and only then will this 305 * {@code BiPredicate} return {@code TRUE}. In this function-pointer, the comparison performed 306 * will ignore the case of the arguments. Before the equality-comparison is performed, the 307 * {@code java.lang.String.trim()} method will be invoked on the 308 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode}. 309 * 310 * @see StrCmpr#equalsXOR_CI(String, String[]) 311 */ 312 public static final TextComparitor EQ_CASE_INSENSITIVE_TRIM = 313 (String s, String[] sArr) -> StrCmpr.equalsXOR_CI(s.trim(), sArr); 314 315 /** 316 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 317 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 318 * If precisely one of the compare-{@code String's} equal the 319 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode}, then and only then will this 320 * {@code BiPredicate} return {@code TRUE}. In this function-pointer, the comparison performed 321 * will ignore the case of the arguments. This is an abbreviated version of the identical 322 * {@code TextComparitor} {@link #EQ_CASE_INSENSITIVE_TRIM}. Before the equality-comparison is 323 * performed, the {@code java.lang.String.trim()} method will be invoked on the 324 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode}. 325 * 326 * @see StrCmpr#equalsXOR_CI(String, String[]) 327 */ 328 public static final TextComparitor EQ_CI_TRM = 329 (String s, String[] sArr) -> StrCmpr.equalsXOR_CI(s.trim(), sArr); 330 331 /** 332 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 333 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 334 * If and only if none of the candidates are equal, can this {@code BiPredicate} evaluate to 335 * {@code TRUE}. In this function-pointer, the comparison performed will ignore the case of the 336 * arguments. Before the equality-comparison is performed, the {@code java.lang.String.trim()} 337 * method will be invoked on the attribute-<B STYLE="color: red;">value</B> or 338 * {@code TextNode}. 339 * 340 * @see StrCmpr#equalsNAND_CI(String, String[]) 341 */ 342 public static final TextComparitor NOT_EQ_CASE_INSENSITIVE_TRIM = 343 (String s, String[] sArr) -> StrCmpr.equalsNAND_CI(s.trim(), sArr); 344 345 /** 346 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 347 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 348 * If and only if none of the candidates are equal, can this {@code BiPredicate} evaluate to 349 * {@code TRUE}. In this function-pointer, the comparison performed will ignore the case of the 350 * arguments. This is an abbreviated version of the identical {@code TextComparitor} 351 * {@link #NOT_EQ_CASE_INSENSITIVE_TRIM}. Before the equality-comparison is performed, the 352 * {@code java.lang.String.trim()} method will be invoked on the 353 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode}. 354 * 355 * @see StrCmpr#equalsNAND_CI(String, String[]) 356 */ 357 public static final TextComparitor NOT_EQ_CI_TRM = 358 (String s, String[] sArr) -> StrCmpr.equalsNAND_CI(s.trim(), sArr); 359 360 /** 361 * Will compare an attribute-<B STYLE="color: red;">value</B> {@code String}, or 362 * {@code TextNode} for equality against a list of possible {@code String}-match candidates. 363 * If and only if none of the candidates are equal, can this {@code BiPredicate} evaluate to 364 * {@code TRUE}. In this function-pointer, the comparison performed will ignore the case of the 365 * arguments. Before the equality-comparison is performed, the {@code java.lang.String.trim()} 366 * method will be invoked on the attribute-<B STYLE="color: red;">value</B> or 367 * {@code TextNode}. 368 * 369 * @see StrCmpr#equalsNAND_CI(String, String[]) 370 */ 371 public static final TextComparitor EQ_CI_NAND_TRM = 372 (String s, String[] sArr) -> StrCmpr.equalsNAND_CI(s.trim(), sArr); 373 374 375 // *************************************************************************************************** 376 // CONTAINS TESTING 377 // *************************************************************************************************** 378 379 /** 380 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to identify whether 381 * it contains <I>at least one match</I> out of a list compare-{@code String's}. 382 * 383 * @see StrCmpr#containsOR(String, String[]) 384 */ 385 public static final TextComparitor CONTAINS = StrCmpr::containsOR; 386 387 /** 388 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to identify whether 389 * it contains <I>a match for every string</I> in the list compare-{@code String's}. 390 * 391 * @see StrCmpr#containsAND(String, String[]) 392 */ 393 public static final TextComparitor CONTAINS_AND = StrCmpr::containsAND; 394 395 /** 396 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to identify if it 397 * will <I>match precisely one and only one</I> {@code String} from a list of 398 * compare-{@code String's}. 399 * 400 * @see StrCmpr#containsXOR(String, String[]) 401 */ 402 public static final TextComparitor CONTAINS_XOR = StrCmpr::containsXOR; 403 404 /** 405 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to ensure that it 406 * <I>does not contain any matches</I> with the list of compare-{@code String's}. 407 * 408 * @see StrCmpr#containsNAND(String, String[]) 409 */ 410 public static final TextComparitor CONTAINS_NAND = StrCmpr::containsNAND; 411 412 /** 413 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to identify whether 414 * it contains <I>at least one match</I> out of a list of compare-{@code String's}. 415 * 416 * @see StrCmpr#containsOR(String, String[]) 417 */ 418 public static final TextComparitor CONTAINS_OR = StrCmpr::containsOR; 419 420 /** 421 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to identify whether 422 * it contains <I>at least one match</I> out of a list compare-{@code String's}. This field 423 * instance has an abbreviated name (for convenience), but identical function-pointer to 424 * {@link #CONTAINS} (and also {@link #CONTAINS_OR}). 425 * 426 * @see StrCmpr#containsOR(String, String[]) 427 */ 428 public static final TextComparitor CN = StrCmpr::containsOR; 429 430 /** 431 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to identify whether 432 * it contains <I>at least one match</I> out of a list compare-{@code String's}. This field 433 * instance has an abbreviated name (for convenience), but identical function-pointer to 434 * {@link #CONTAINS_OR} (and also {@link #CONTAINS}). 435 * 436 * @see StrCmpr#containsOR(String, String[]) 437 */ 438 public static final TextComparitor CN_OR = StrCmpr::containsOR; 439 440 /** 441 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to ensure that it 442 * <I>does not contain any matches</I> with the list of compare-{@code String's}. This field 443 * instance has an abbreviated name (for convenience), but identical function-pointer to 444 * {@link #CONTAINS_AND}. 445 * 446 * @see StrCmpr#containsAND(String, String[]) 447 */ 448 public static final TextComparitor CN_AND = StrCmpr::containsAND; 449 450 /** 451 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to identify if it 452 * will <I>match precisely one and only one</I> {@code String} from a list of 453 * compare-{@code String's}. This field instance has an abbreviated name (for convenience), but 454 * identical function-pointer to {@link #CONTAINS_XOR}. 455 * 456 * @see StrCmpr#containsXOR(String, String[]) 457 */ 458 public static final TextComparitor CN_XOR = StrCmpr::containsXOR; 459 460 /** 461 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to ensure that it 462 * <I>does not contain any matches</I> with the list of compare-{@code String's}. This field 463 * instance has an abbreviated name (for convenience), but identical function-pointer to 464 * {@link #CONTAINS_NAND}. 465 * 466 * @see StrCmpr#containsNAND(String, String[]) 467 */ 468 public static final TextComparitor CN_NAND = StrCmpr::containsNAND; 469 470 /** 471 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to ensure that it 472 * <I>does not contain any matches</I> with the list of compare-{@code String's}. This field 473 * instance differs in name only with other pre-defined {@code static} fields in this class. 474 * It's function pointer is identical to: {@link #CN_NAND}, {@link #CONTAINS_NAND} and 475 * {@link #DOES_NOT_CONTAIN}. 476 * 477 * @see StrCmpr#containsNAND(String, String[]) 478 */ 479 public static final TextComparitor NOT_CN = StrCmpr::containsNAND; 480 481 /** 482 * Checks an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to ensure that it 483 * <I>does not contain any matches</I> with the list of compare-{@code String's}. It's 484 * function pointer is identical to: {@link #CN_NAND}, {@link #CONTAINS_NAND} and 485 * {@link #NOT_CN}. 486 * 487 * @see StrCmpr#containsNAND(String, String[]) 488 */ 489 public static final TextComparitor DOES_NOT_CONTAIN = StrCmpr::containsNAND; 490 491 492 // *************************************************************************************************** 493 // CONTAINS TESTING - Case Insensitive versions 494 // *************************************************************************************************** 495 496 /** 497 * Similar to {@code public static} field {@link #CONTAINS}, this function-pointer checks an 498 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to identify whether it 499 * contains <I>at least one match</I> out of a list compare-{@code String's}. The difference 500 * between this field and the aforementioned {@code public static} field is that this one 501 * ({@code 'CONTAINS_CASE_INSENSITIVE'}) ignores the case of the lettering when performing the 502 * {@code String} comparisons. 503 * 504 * @see StrCmpr#containsOR_CI(String, String[]) 505 */ 506 public static final TextComparitor CONTAINS_CASE_INSENSITIVE = StrCmpr::containsOR_CI; 507 508 /** 509 * Just like {@code public static} field {@link #CONTAINS_AND}, this function-pointer checks an 510 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to identify whether it 511 * contains <I>a match for every string</I> in the list compare-{@code String's}. The 512 * difference between this field and the aforementioned {@code public static} field is that 513 * this one ({@code 'CONTAINS_CASE_INSENSITIVE_AND'}) ignores the case of the lettering when 514 * performing the {@code String} comparisons. 515 * 516 * @see StrCmpr#containsAND_CI(String, String[]) 517 */ 518 public static final TextComparitor CONTAINS_CASE_INSENSITIVE_AND = StrCmpr::containsAND_CI; 519 520 /** 521 * Similar to {@code public static} field {@link #CONTAINS_XOR}, this function-pointer checks 522 * an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to identify if it will 523 * <I>match precisely one and only one</I> {@code String} from a list of 524 * compare-{@code String's}. The difference between this field and the aforementioned 525 * {@code public static} field is that this one ({@code 'CONTAINS_CASE_INSENSITIVE_XOR'}) 526 * ignores the case of the lettering when performing the {@code String} comparisons. 527 * 528 * @see StrCmpr#containsXOR_CI(String, String[]) 529 */ 530 public static final TextComparitor CONTAINS_CASE_INSENSITIVE_XOR = StrCmpr::containsXOR_CI; 531 532 /** 533 * Just like {@code public static} field {@link #CONTAINS_NAND}, this function pointer checks 534 * an attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to ensure that it <I>does 535 * not contain any matches</I> with the list of compare-{@code String's}. The difference 536 * between this field and the aforementioned {@code public static} field is that this one 537 * ({@code 'CONTAINS_CASE_INSENSITIVE_NAND'}) ignores the case of the lettering when performing 538 * the {@code String} comparisons. 539 * 540 * @see StrCmpr#containsNAND_CI(String, String[]) 541 */ 542 public static final TextComparitor CONTAINS_CASE_INSENSITIVE_NAND = StrCmpr::containsNAND_CI; 543 544 /** 545 * Similar to {@code public static} field {@link #CONTAINS_OR}, this function-pointer checks an 546 * attribute-<B STYLE="color: red;">value</B> or {@code TextNode} to identify whether it 547 * contains <I>at least one match</I> out of a list of compare-{@code String's}. The 548 * difference between this field and the aforementioned {@code public static} field is that 549 * this one ({@code 'CONTAINS_CASE_INSENSITIVE_OR'}) ignores the case of the lettering when 550 * performing the {@code String} comparisons. 551 * 552 * @see StrCmpr#containsOR_CI(String, String[]) 553 */ 554 public static final TextComparitor CONTAINS_CASE_INSENSITIVE_OR = StrCmpr::containsOR_CI; 555 556 /** 557 * This function pointer's name is just an abbreviation for the {@code public static} field 558 * named {@link #CONTAINS_CASE_INSENSITIVE}. It points to the same method in {@code class 559 * StrCmpr}. 560 * 561 * @see StrCmpr#containsOR_CI(String, String[]) 562 */ 563 public static final TextComparitor CN_CI = StrCmpr::containsOR_CI; 564 565 /** 566 * This function pointer's name is just an abbreviation for the {@code public static} field 567 * named {@link #CONTAINS_CASE_INSENSITIVE_OR}. It points to the same method in {@code class 568 * StrCmpr}. 569 * 570 * @see StrCmpr#containsOR_CI(String, String[]) 571 */ 572 public static final TextComparitor CN_CI_OR = StrCmpr::containsOR_CI; 573 574 /** 575 * This function pointer's name is just an abbreviation for the {@code public static} field 576 * named {@link #CONTAINS_CASE_INSENSITIVE_AND}. It points to the same method in {@code class 577 * StrCmpr}. 578 * 579 * @see StrCmpr#containsAND_CI(String, String[]) 580 */ 581 public static final TextComparitor CN_CI_AND = StrCmpr::containsAND_CI; 582 583 /** 584 * This function pointer's name is just an abbreviation for the {@code public static} field 585 * named {@link #CONTAINS_CASE_INSENSITIVE_XOR}. It points to the same method in {@code class 586 * StrCmpr}. 587 * 588 * @see StrCmpr#containsXOR_CI(String, String[]) 589 */ 590 public static final TextComparitor CN_CI_XOR = StrCmpr::containsXOR_CI; 591 592 /** 593 * This function pointer's name is just an abbreviation for the {@code public static} field 594 * named {@link #CONTAINS_CASE_INSENSITIVE_NAND}. It points to the same method in {@code class 595 * StrCmpr}. 596 * 597 * @see StrCmpr#containsNAND_CI(String, String[]) 598 */ 599 public static final TextComparitor CN_CI_NAND = StrCmpr::containsNAND_CI; 600 601 /** 602 * This function pointer checks an attribute-<B STYLE="color: red;">value</B> or 603 * {@code TextNode} to ensure that it <I>does not contain any matches</I> with the list of 604 * compare-{@code String's}. The comparisons method used ignores the case of the text in the 605 * string parameters. Do note that all four of the following {@code static} fields 606 * {@link #NOT_CN_CI}, {@link #DOES_NOT_CONTAIN_CASE_INSENSITIVE}, {@link #CN_CI_NAND} and 607 * {@link #CONTAINS_CASE_INSENSITIVE_NAND} point to the same {@code StrCmpr} method. Since the 608 * variable names trade-off readability and brevity, this is done for convenience. 609 * 610 * @see StrCmpr#containsNAND_CI(String, String[]) 611 */ 612 public static final TextComparitor NOT_CN_CI = StrCmpr::containsNAND_CI; 613 614 /** 615 * This function pointer checks an attribute-<B STYLE="color: red;">value</B> or 616 * {@code TextNode} to ensure that it <I>does not contain any matches</I> with the list of 617 * compare-{@code String's}. The comparisons method used ignores the case of the text in the 618 * string parameters. Do note that all four of the following {@code static} fields 619 * {@link #NOT_CN_CI}, {@link #DOES_NOT_CONTAIN_CASE_INSENSITIVE}, {@link #CN_CI_NAND}, 620 * and {@link #CONTAINS_CASE_INSENSITIVE_NAND} point to the same {@code StrCmpr} method. 621 * Since the variable names trade-off readability and brevity, this is done for convenience. 622 * 623 * @see StrCmpr#containsNAND_CI(String, String[]) 624 */ 625 public static final TextComparitor DOES_NOT_CONTAIN_CASE_INSENSITIVE = 626 StrCmpr::containsNAND_CI; 627 628 629 // *************************************************************************************************** 630 // START-WITH 631 // *************************************************************************************************** 632 633 /** 634 * Checks an input 'source {@code String}' (usually an inner-tag 635 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the initial 636 * characters (the 'start' of the source-{@code String}) will <I>match with precisely one</I> 637 * of the java {@code var-args String...} compare-{@code String's} list. 638 * 639 * @see StrCmpr#startsWithXOR(String, String[]) 640 */ 641 public static final TextComparitor STARTS_WITH = StrCmpr::startsWithXOR; 642 643 /** 644 * Checks an input 'source {@code String}' (usually an inner-tag 645 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the initial 646 * characters (the 'start' of the source-{@code String}) <I>will not match with any</I> of the 647 * java {@code var-args String...} compare-{@code String's} list. 648 * 649 * @see StrCmpr#startsWithNAND(String, String[]) 650 */ 651 public static final TextComparitor DOES_NOT_START_WITH = StrCmpr::startsWithNAND; 652 653 /** 654 * Nearly identical to {@link #STARTS_WITH}, but here the function-pointer points to a method 655 * that ignores case when performing the comparisons. This {@code public static} field checks 656 * an input 'source {@code String}' (usually an inner-tag <B STYLE="color: red;">value</B> or a 657 * {@code TextNode}) to verify that the initial characters (the 'start' of the 658 * source-{@code String}) will <I>match with precisely one</I> of the java {@code var-args 659 * String...} compare-{@code String's} list. 660 * 661 * @see StrCmpr#startsWithXOR_CI(String, String[]) 662 */ 663 public static final TextComparitor STARTS_WITH_CASE_INSENSITIVE = StrCmpr::startsWithXOR_CI; 664 665 /** 666 * Nearly identical to {@link #DOES_NOT_START_WITH}, but here the function-pointer points to a 667 * method that ignores case when performing the comparisons. This {@code public static} field 668 * checks an input 'source {@code String}' (usually an inner-tag 669 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the initial 670 * characters (the 'start' of the source-{@code String}) <I>will not match with any</I> of the 671 * java {@code var-args String...} compare-{@code String's} list. 672 * 673 * @see StrCmpr#startsWithNAND_CI(String, String[]) 674 */ 675 public static final TextComparitor DOES_NOT_START_WITH_CASE_INSENSITIVE = 676 StrCmpr::startsWithNAND_CI; 677 678 /** 679 * A static, function-pointer, field with an abbreviated name identical to field 680 * {@link #STARTS_WITH}. 681 * 682 * <BR /><BR />Checks an input 'source {@code String}' (usually an inner-tag 683 * <B STYLE="color: red;"> value</B> or a {@code TextNode}) to verify that the initial 684 * characters (the 'start' of the source-{@code String}) will <I>match with precisely one</I> 685 * of the java {@code var-args String...} compare-{@code String's} list. 686 * 687 * @see StrCmpr#startsWithXOR(String, String[]) 688 */ 689 public static final TextComparitor SW = StrCmpr::startsWithXOR; 690 691 /** 692 * A static, function-pointer, field with an abbreviated name identical to field 693 * {@link #DOES_NOT_START_WITH}. 694 * 695 * <BR /><BR />In fact, the following are all identical method references: 696 * 697 * <BR /><BR /><UL CLASS=JDUL> 698 * <LI>{@link #DOES_NOT_START_WITH}</LI> 699 * <LI>{@link #NOT_SW}</LI> 700 * <LI>{@link #SW_NAND}</LI> 701 * <LI>{@link StrCmpr#startsWithNAND(String, String[])}</LI> 702 * </UL> 703 * 704 * <BR />They are just abbreviated names to allow for trading-off 'code readability' and 705 * brevity. 706 * 707 * <BR /><BR />Checks an input 'source {@code String}' (usually an inner-tag 708 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the initial 709 * characters (the 'start' of the source-{@code String}) <I>will not match with any</I> of the 710 * java {@code var-args String...} compare-{@code String's} list. 711 * 712 * @see StrCmpr#startsWithNAND(String, String[]) 713 */ 714 public static final TextComparitor NOT_SW = StrCmpr::startsWithNAND; 715 716 /** 717 * A static, function-pointer, field with an abbreviated name identical to field 718 * {@link #DOES_NOT_START_WITH}. 719 * 720 * <BR /><BR />In fact, the following are all identical method references: 721 * 722 * <BR /><BR /><UL CLASS=JDUL> 723 * <LI>{@link #DOES_NOT_START_WITH}</LI> 724 * <LI>{@link #NOT_SW}</LI> 725 * <LI>{@link #SW_NAND}</LI> 726 * <LI>{@link StrCmpr#startsWithNAND(String, String[])}</LI> 727 * </UL> 728 * 729 * <BR />They are just abbreviated names to allow for trading-off 'code readability' and 730 * brevity. 731 * 732 * <BR /><BR />Checks an input 'source {@code String}' (usually an inner-tag 733 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the initial 734 * characters (the 'start' of the source-{@code String}) <I>will not match with any</I> of the 735 * java {@code var-args String...} compare-{@code String's} list. 736 * 737 * @see StrCmpr#startsWithNAND(String, String[]) 738 */ 739 public static final TextComparitor SW_NAND = StrCmpr::startsWithNAND; 740 741 /** 742 * A static, function-pointer, field with an abbreviated name identical to field 743 * {@link #STARTS_WITH_CASE_INSENSITIVE}. 744 * 745 * <BR /><BR />Nearly identical to {@link #STARTS_WITH}, but here the function-pointer points 746 * to a method that ignores case when performing the comparisons. This {@code public static} 747 * field checks an input 'source {@code String}' (usually an inner-tag 748 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the initial 749 * characters (the 'start' of the source-{@code String}) will <I>match with precisely one</I> 750 * of the java {@code var-args String...} compare-{@code String's} list. 751 * 752 * @see StrCmpr#startsWithXOR_CI(String, String[]) 753 */ 754 public static final TextComparitor SW_CI = StrCmpr::startsWithXOR_CI; 755 756 /** 757 * A static, function-pointer, field with an abbreviated name identical to field 758 * {@link #DOES_NOT_START_WITH_CASE_INSENSITIVE}. 759 * 760 * <BR /><BR />In fact, the following are all identical method references: 761 * 762 * <BR /><BR /><UL CLASS=JDUL> 763 * <LI>{@link #DOES_NOT_START_WITH_CASE_INSENSITIVE}</LI> 764 * <LI>{@link #NOT_SW_CI}</LI> 765 * <LI>{@link #SW_CI_NAND}</LI> 766 * <LI>{@link StrCmpr#startsWithNAND_CI(String, String[])}</LI> 767 * </UL> 768 * 769 * <BR /> They are just abbreviated names to allow for trading-off 'code readability' and 770 * brevity. 771 * 772 * <BR /><BR />Nearly identical to {@link #DOES_NOT_START_WITH}, but here the function-pointer 773 * points to a method that ignores case when performing the comparisons. This {@code public 774 * static} field checks an input 'source {@code String}' (usually an inner-tag 775 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the initial 776 * characters (the 'start' of the source-{@code String}) <I>will not match with any</I> of the 777 * java {@code var-args String...} compare-{@code String's} list. 778 * 779 * @see StrCmpr#startsWithNAND_CI(String, String[]) 780 */ 781 public static final TextComparitor NOT_SW_CI = StrCmpr::startsWithNAND_CI; 782 783 /** 784 * A static, function-pointer, field with an abbreviated name identical to field 785 * {@link #DOES_NOT_START_WITH_CASE_INSENSITIVE}. 786 * 787 * <BR /><BR />In fact, the following are all identical method references: 788 * 789 * <BR /><BR /><UL CLASS=JDUL> 790 * <LI>{@link #DOES_NOT_START_WITH_CASE_INSENSITIVE}</LI> 791 * <LI>{@link #NOT_SW_CI}</LI> 792 * <LI>{@link #SW_CI_NAND}</LI> 793 * <LI>{@link StrCmpr#startsWithNAND_CI(String, String[])}</LI> 794 * </UL> 795 * 796 * <BR /><BR /> They are just abbreviated names to allow for trading-off 'code readability' and 797 * brevity. 798 * 799 * <BR /><BR />Nearly identical to {@link #DOES_NOT_START_WITH}, but here the function-pointer 800 * points to a method that ignores case when performing the comparisons. This {@code public 801 * static} field checks an input 'source {@code String}' (usually an inner-tag 802 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the initial 803 * characters (the 'start' of the source-{@code String}) <I>will not match with any</I> of the 804 * java {@code var-args String...} compare-{@code String's} list. 805 * 806 * @see StrCmpr#startsWithNAND_CI(String, String[]) 807 */ 808 public static final TextComparitor SW_CI_NAND = StrCmpr::startsWithNAND_CI; 809 810 811 // *************************************************************************************************** 812 // START-WITH 813 // *************************************************************************************************** 814 815 /** 816 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 817 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 818 * {@link #STARTS_WITH}. 819 * 820 * @see StrCmpr#startsWithXOR(String, String[]) 821 */ 822 public static final TextComparitor STARTS_WITH_TRIM = 823 (String s, String[] sArr) -> StrCmpr.startsWithXOR(s.trim(), sArr); 824 825 /** 826 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 827 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 828 * {@link #DOES_NOT_START_WITH}. 829 * 830 * @see StrCmpr#startsWithNAND(String, String[]) 831 */ 832 public static final TextComparitor DOES_NOT_START_WITH_TRIM = 833 (String s, String[] sArr) -> StrCmpr.startsWithNAND(s.trim(), sArr); 834 835 /** 836 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 837 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 838 * {@link #STARTS_WITH_CASE_INSENSITIVE}. 839 * 840 * @see StrCmpr#startsWithXOR_CI(String, String[]) 841 */ 842 public static final TextComparitor STARTS_WITH_CASE_INSENSITIVE_TRIM = 843 (String s, String[] sArr) -> StrCmpr.startsWithXOR_CI(s.trim(), sArr); 844 845 /** 846 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 847 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 848 * {@link #DOES_NOT_START_WITH_CASE_INSENSITIVE}. 849 * 850 * @see StrCmpr#startsWithNAND_CI(String, String[]) 851 */ 852 public static final TextComparitor DOES_NOT_START_WITH_CASE_INSENSITIVE_TRIM = 853 (String s, String[] sArr) -> StrCmpr.startsWithNAND_CI(s.trim(), sArr); 854 855 /** 856 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 857 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 858 * {@link #SW}. 859 * 860 * @see StrCmpr#startsWithXOR(String, String[]) 861 */ 862 public static final TextComparitor SW_TRM = 863 (String s, String[] sArr) -> StrCmpr.startsWithXOR(s.trim(), sArr); 864 865 /** 866 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 867 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 868 * {@link #NOT_SW}. 869 * 870 * @see StrCmpr#startsWithNAND(String, String[]) 871 */ 872 public static final TextComparitor NOT_SW_TRM = 873 (String s, String[] sArr) -> StrCmpr.startsWithNAND(s.trim(), sArr); 874 875 /** 876 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 877 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 878 * {@link #SW_NAND}. 879 * 880 * @see StrCmpr#startsWithNAND(String, String[]) 881 */ 882 public static final TextComparitor SW_NAND_TRM = 883 (String s, String[] sArr) -> StrCmpr.startsWithNAND(s.trim(), sArr); 884 885 /** 886 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 887 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 888 * {@link #SW_CI}. 889 * 890 * @see StrCmpr#startsWithXOR_CI(String, String[]) 891 */ 892 public static final TextComparitor SW_CI_TRM = 893 (String s, String[] sArr) -> StrCmpr.startsWithXOR_CI(s.trim(), sArr); 894 895 /** 896 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 897 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 898 * {@link #NOT_SW_CI}. 899 * 900 * @see StrCmpr#startsWithNAND_CI(String, String[]) 901 */ 902 public static final TextComparitor NOT_SW_CI_TRM = 903 (String s, String[] sArr) -> StrCmpr.startsWithNAND_CI(s.trim(), sArr); 904 905 /** 906 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 907 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 908 * {@link #SW_CI_NAND}. 909 * 910 * @see #SW_CI_NAND 911 * @see StrCmpr#startsWithNAND_CI(String, String[]) 912 */ 913 public static final TextComparitor SW_CI_NAND_TRM = 914 (String s, String[] sArr) -> StrCmpr.startsWithNAND_CI(s.trim(), sArr); 915 916 917 // *************************************************************************************************** 918 // END-WITH 919 // *************************************************************************************************** 920 921 /** 922 * Checks an input 'source {@code String}' (usually an inner-tag 923 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the ending characters 924 * (the 'tail' of the source-{@code String}) will <I>match with precisely one</I> of the java 925 * {@code var-args String...} compare-{@code String's} list. 926 * 927 * @see StrCmpr#endsWithXOR(String, String[]) 928 */ 929 public static final TextComparitor ENDS_WITH = StrCmpr::endsWithXOR; 930 931 /** 932 * Checks an input 'source {@code String}' (usually an inner-tag 933 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the ending characters 934 * (the 'tail' of the source-{@code String}) <I>will not match with any</I> of the java 935 * {@code var-args String...} compare-{@code String's} list. 936 * 937 * @see StrCmpr#endsWithNAND(String, String[]) 938 */ 939 public static final TextComparitor DOES_NOT_END_WITH = StrCmpr::endsWithNAND; 940 941 /** 942 * Nearly identical to {@link #ENDS_WITH}, but here the function-pointer points to a method 943 * that ignores case when performing the comparisons. This {@code public static} field checks 944 * an input 'source {@code String}' (usually an inner-tag <B STYLE="color: red;">value</B> or a 945 * {@code TextNode}) to verify that the ending characters (the 'tail' of the 946 * source-{@code String}) will <I>match with precisely one</I> of the java {@code var-args 947 * String...} compare-{@code String's} list. 948 * 949 * @see StrCmpr#endsWithXOR_CI(String, String[]) 950 */ 951 public static final TextComparitor ENDS_WITH_CASE_INSENSITIVE = StrCmpr::endsWithXOR_CI; 952 953 /** 954 * Nearly identical to {@link #DOES_NOT_END_WITH}, but here the function-pointer points to a 955 * method that ignores case when performing the comparisons. This {@code public static} field 956 * checks an input 'source {@code String}' (usually an inner-tag 957 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the ending characters 958 * (the 'tail' of the source-{@code String}) <I>will not match with any</I> of the java 959 * {@code var-args String...} compare-{@code String's} list. 960 * 961 * @see StrCmpr#endsWithNAND_CI(String, String[]) 962 */ 963 public static final TextComparitor DOES_NOT_END_WITH_CASE_INSENSITIVE = 964 StrCmpr::endsWithNAND_CI; 965 966 /** 967 * A static, function-pointer, field with an abbreviated name identical to field 968 * {@link #ENDS_WITH}. 969 * 970 * <BR /><BR />Checks an input 'source {@code String}' (usually an inner-tag 971 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the ending characters 972 * (the 'tail' of the source-{@code String}) will <I>match with precisely one</I> of the java 973 * {@code var-args String...} compare-{@code String's} list. 974 * 975 * @see StrCmpr#endsWithXOR(String, String[]) 976 */ 977 public static final TextComparitor EW = StrCmpr::endsWithXOR; 978 979 /** 980 * A static, function-pointer, field with an abbreviated name identical to field 981 * {@link #DOES_NOT_END_WITH}. 982 * 983 * <BR /><BR />In fact, the following are all identical method references: 984 * 985 * <BR /><BR /><UL CLASS=JDUL> 986 * <LI>{@link #DOES_NOT_END_WITH}</LI> 987 * <LI>{@link #NOT_EW}</LI> 988 * <LI>{@link #EW_NAND}</LI> 989 * <LI>{@link StrCmpr#endsWithNAND(String, String[])}</LI> 990 * </UL> 991 * 992 * <BR />They are just abbreviated names to allow for trading-off 'code readability' and 993 * brevity. 994 * 995 * <BR /><BR />Checks an input 'source {@code String}' (usually an inner-tag 996 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the ending characters 997 * (the 'tail' of the source-{@code String}) <I>will not match with any</I> of the java 998 * {@code var-args String...} compare-{@code String's} list. 999 * 1000 * @see StrCmpr#endsWithNAND(String, String[]) 1001 */ 1002 public static final TextComparitor NOT_EW = StrCmpr::endsWithNAND; 1003 1004 /** 1005 * A static, function-pointer, field with an abbreviated name identical to field 1006 * {@link #DOES_NOT_END_WITH}. 1007 * 1008 * <BR /><BR />In fact, the following are all identical method references: 1009 * 1010 * <BR /><BR /><UL CLASS=JDUL> 1011 * <LI>{@link #DOES_NOT_END_WITH}</LI> 1012 * <LI>{@link #NOT_EW}</LI> 1013 * <LI>{@link #EW_NAND}</LI> 1014 * <LI>{@link StrCmpr#endsWithNAND(String, String[])}</LI> 1015 * </UL> 1016 * 1017 * <BR />They are just abbreviated names to allow for trading-off 'code readability' and 1018 * brevity. 1019 * 1020 * <BR /><BR />Checks an input 'source {@code String}' (usually an inner-tag 1021 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the ending characters 1022 * (the 'tail' of the source-{@code String}) <I>will not match with any</I> of the java 1023 * {@code var-args String...} compare-{@code String's} list. 1024 * 1025 * @see StrCmpr#endsWithNAND(String, String[]) 1026 */ 1027 public static final TextComparitor EW_NAND = StrCmpr::endsWithNAND; 1028 1029 /** 1030 * A static, function-pointer, field with an abbreviated name identical to field 1031 * {@link #ENDS_WITH_CASE_INSENSITIVE}. 1032 * 1033 * <BR /><BR />Nearly identical to {@link #ENDS_WITH}, but here the function-pointer points to 1034 * a method that ignores case when performing the comparisons. This {@code public static} 1035 * field checks an input 'source {@code String}' (usually an inner-tag 1036 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the ending characters 1037 * (the 'tail' of the source-{@code String}) will <I>match with precisely one</I> of the java 1038 * {@code var-args String...} compare-{@code String's} list. 1039 * 1040 * @see StrCmpr#endsWithXOR_CI(String, String[]) 1041 */ 1042 public static final TextComparitor EW_CI = StrCmpr::endsWithXOR_CI; 1043 1044 /** 1045 * A static, function-pointer, field with an abbreviated name identical to field 1046 * {@link #DOES_NOT_END_WITH_CASE_INSENSITIVE}. 1047 * 1048 * <BR /><BR />In fact, the following are all identical method references: 1049 * 1050 * <BR /><BR /><UL CLASS=JDUL> 1051 * <LI>{@link #DOES_NOT_END_WITH_CASE_INSENSITIVE}</LI> 1052 * <LI>{@link #NOT_EW_CI}</LI> 1053 * <LI>{@link #EW_CI_NAND}</LI> 1054 * <LI>{@link StrCmpr#endsWithNAND_CI(String, String[])}</LI> 1055 * </UL> 1056 * 1057 * <BR />They are just abbreviated names to allow for trading-off 'code readability' and 1058 * brevity. 1059 * 1060 * <BR /><BR />Nearly identical to {@link #DOES_NOT_END_WITH}, but here the function-pointer 1061 * points to a method that ignores case when performing the comparisons. This {@code public 1062 * static} field checks an input 'source {@code String}' (usually an inner-tag 1063 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the ending characters 1064 * (the 'tail' of the source-{@code String}) <I>will not match with any</I> of the java 1065 * {@code var-args String...} compare-{@code String's} list. 1066 * 1067 * @see StrCmpr#endsWithNAND_CI(String, String[]) 1068 */ 1069 public static final TextComparitor NOT_EW_CI = StrCmpr::endsWithNAND_CI; 1070 1071 /** 1072 * A static, function-pointer, field with an abbreviated name identical to field 1073 * {@link #DOES_NOT_END_WITH_CASE_INSENSITIVE}. 1074 * 1075 * <BR /><BR />In fact, the following are all identical method references: 1076 * 1077 * <BR /><BR /><UL CLASS=JDUL> 1078 * <LI>{@link #DOES_NOT_END_WITH_CASE_INSENSITIVE}</LI> 1079 * <LI>{@link #NOT_EW_CI}</LI> 1080 * <LI>{@link #EW_CI_NAND}</LI> 1081 * <LI>{@link StrCmpr#endsWithNAND_CI(String, String[])}</LI> 1082 * </UL> 1083 * 1084 * <BR />They are just abbreviated names to allow for trading-off 'code readability' and 1085 * brevity. 1086 * 1087 * <BR /><BR />Nearly identical to {@link #DOES_NOT_END_WITH}, but here the function-pointer 1088 * points to a method that ignores case when performing the comparisons. This {@code public 1089 * static} field checks an input 'source {@code String}' (usually an inner-tag 1090 * <B STYLE="color: red;">value</B> or a {@code TextNode}) to verify that the ending characters 1091 * (the 'tail' of the source-{@code String}) <I>will not match with any</I> of the java 1092 * {@code var-args String...} compare-{@code String's} list. 1093 * 1094 * @see StrCmpr#endsWithNAND_CI(String, String[]) 1095 */ 1096 public static final TextComparitor EW_CI_NAND = StrCmpr::endsWithNAND_CI; 1097 1098 1099 // *************************************************************************************************** 1100 // END-WITH 1101 // *************************************************************************************************** 1102 1103 /** 1104 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 1105 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 1106 * {@link #ENDS_WITH}. 1107 * 1108 * @see #ENDS_WITH 1109 * @see StrCmpr#endsWithXOR(String, String[]) 1110 */ 1111 public static final TextComparitor ENDS_WITH_TRIM = 1112 (String s, String[] sArr) -> StrCmpr.endsWithXOR(s.trim(), sArr); 1113 1114 /** 1115 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 1116 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 1117 * {@link #DOES_NOT_END_WITH}. 1118 * 1119 * @see #DOES_NOT_END_WITH 1120 * @see StrCmpr#endsWithNAND(String, String[]) 1121 */ 1122 public static final TextComparitor DOES_NOT_END_WITH_TRIM = 1123 (String s, String[] sArr) -> StrCmpr.endsWithNAND(s.trim(), sArr); 1124 1125 /** 1126 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 1127 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 1128 * {@link #ENDS_WITH_CASE_INSENSITIVE}. 1129 * 1130 * @see #ENDS_WITH_CASE_INSENSITIVE 1131 * @see StrCmpr#endsWithXOR_CI(String, String[]) 1132 */ 1133 public static final TextComparitor ENDS_WITH_CASE_INSENSITIVE_TRIM = 1134 (String s, String[] sArr) -> StrCmpr.endsWithXOR_CI(s.trim(), sArr); 1135 1136 /** 1137 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 1138 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 1139 * {@link #DOES_NOT_END_WITH_CASE_INSENSITIVE}. 1140 * 1141 * @see #DOES_NOT_END_WITH_CASE_INSENSITIVE 1142 * @see StrCmpr#endsWithNAND_CI(String, String[]) 1143 */ 1144 public static final TextComparitor DOES_NOT_END_WITH_CASE_INSENSITIVE_TRIM = 1145 (String s, String[] sArr) -> StrCmpr.endsWithNAND_CI(s.trim(), sArr); 1146 1147 /** 1148 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 1149 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 1150 * {@link #EW}. 1151 * 1152 * @see #EW 1153 * @see StrCmpr#endsWithXOR(String, String[]) 1154 */ 1155 public static final TextComparitor EW_TRM = 1156 (String s, String[] sArr) -> StrCmpr.endsWithXOR(s.trim(), sArr); 1157 1158 /** 1159 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 1160 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 1161 * {@link #NOT_EW}. 1162 * 1163 * @see #NOT_EW 1164 * @see StrCmpr#endsWithNAND(String, String[]) 1165 */ 1166 public static final TextComparitor NOT_EW_TRM = 1167 (String s, String[] sArr) -> StrCmpr.endsWithNAND(s.trim(), sArr); 1168 1169 /** 1170 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 1171 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 1172 * {@link #EW_NAND}. 1173 * 1174 * @see #EW_NAND 1175 * @see StrCmpr#endsWithNAND(String, String[]) 1176 */ 1177 public static final TextComparitor EW_NAND_TRM = 1178 (String s, String[] sArr) -> StrCmpr.endsWithNAND(s.trim(), sArr); 1179 1180 /** 1181 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 1182 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 1183 * {@link #EW_CI}. 1184 * 1185 * @see #EW_CI 1186 * @see StrCmpr#endsWithXOR_CI(String, String[]) 1187 */ 1188 public static final TextComparitor EW_CI_TRM = 1189 (String s, String[] sArr) -> StrCmpr.endsWithXOR_CI(s.trim(), sArr); 1190 1191 /** 1192 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 1193 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 1194 * {@link #NOT_EW_CI}. 1195 * 1196 * @see #NOT_EW_CI 1197 * @see StrCmpr#endsWithNAND_CI(String, String[]) 1198 */ 1199 public static final TextComparitor NOT_EW_CI_TRM = 1200 (String s, String[] sArr) -> StrCmpr.endsWithNAND_CI(s.trim(), sArr); 1201 1202 /** 1203 * Invokes {@code java.lang.String.trim()} on the first input-parameter; although the remainder 1204 * of this {@code BiPredicate<String, String[]} is identical to {@code public static} field 1205 * {@link #EW_CI_NAND}. 1206 * 1207 * @see #EW_CI_NAND 1208 * @see StrCmpr#endsWithNAND_CI(String, String[]) 1209 */ 1210 public static final TextComparitor EW_CI_NAND_TRM = 1211 (String s, String[] sArr) -> StrCmpr.endsWithNAND_CI(s.trim(), sArr); 1212 1213 1214 1215 /** 1216 * Helper / Convenience Method. In almost all cases, this will return the actual field / 1217 * variable name of an instance of {@code TextComparitor}. The lookup method uses Java 1218 * Reflection. Internal exception & error reporting logic makes use of this 1219 * method (where it works properly), but if this method is invoked on a user-supplied 1220 * {@code TextComparitor}, ths method will not be able to 'guess' the variable or field 1221 * name from whence that instance was derived or created. 1222 * 1223 * <BR /><BR /><B>USE:</B> For {@link TextComparitor#EQ_CASE_INSENSITIVE}, this method 1224 * returns the <B>Java {@code String}</B> {@code "EQ_CASE_INSENSITIVE"}. 1225 * 1226 * <BR /><BR /><B>AGAIN:</B>There are <I>certain cases</I> where this method will fail. The 1227 * test performed here uses a reference-equality comparison. For instance, if the user 1228 * requests the name of a <I>"Serialized Version"</I> of a {@code TextComparitor}, then the 1229 * instance-reference loaded from a Serialized Object File, and the instance-reference stored 1230 * inside this class would be different. If, indeed, there were two instances of 1231 * {@code 'TextComparitor.STARTS_WITH'} then the serialized version of 1232 * {@code 'TextComparitor.STARTS_WITH'} (when invoking this method) would not properly return 1233 * the {@code String 'STARTS_WITH'} 1234 * 1235 * <BR /><BR /><B>PRIMARILY:</B> This method is used by one of the exception reporting 1236 * mechanisms, and therefore neither relies nor requires serialized, saved, or user-created 1237 * {@code TextComparitor's}. For those purposes, retreiving the {@code static} field-name 1238 * of the {@code TextComparitor's} that are passed here will work fine. 1239 * 1240 * <BR /><BR /><B><SPAN STYLE="color: red;">AGAIN:</B></SPAN> This method is used internally 1241 * for error-reporting. 1242 * 1243 * @param tc An instance of this class, {@code TextComparitor}, which is a also a 1244 * {@code static} field member of this class. 1245 * 1246 * @return If the reference provided is one of the {@code static} fields which are defined 1247 * inside {@code TextComparitor}, then the name of that field, as a {@code java.lang.String}, 1248 * will be returned. If this is a user-defined {@code TextComparitor}, then it's name will 1249 * not be found, and 'null' shall be returned instead. 1250 * 1251 * <DIV CLASS="EXAMPLE">{@code 1252 * System.out.println(TextComparitor.getName(TextComparitor.EQ)); 1253 * 1254 * // Prints the String: "EQ" 1255 * }</DIV> 1256 */ 1257 public static String getName(TextComparitor tc) 1258 { 1259 Field[] fArr = TextComparitor.class.getDeclaredFields(); 1260 1261 try 1262 { for (Field f : fArr) if (f.get(null) == tc) return f.getName(); } 1263 1264 catch (IllegalAccessException e) 1265 { return null; } 1266 1267 return null; 1268 } 1269}