Interface TextComparitor

  • All Superinterfaces:
    java.util.function.BiPredicate<java.lang.String,​java.lang.String[]>, java.io.Serializable
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface TextComparitor
    extends java.util.function.BiPredicate<java.lang.String,​java.lang.String[]>, java.io.Serializable
    A functional-interface / lambda-target that has many pre-instantiated instances that essentially serves a simplified wrappers for the many String search and comparison utilities provided in Torello.Java.

    The primary use of the class TextComparitor is to provide an easy, seamless way for searching through a Vector<HTMLNode> object. This package contains numerous different variants of "search" all built into a consistently named Vector-search set of classes and methods in this package 'Torello.HTML.NodeSearch.*'.

    Sometimes one may wish to search an HTML page for either 'TagNode' elements, or 'TextNode' elements that contain a type of String. Other times a programmer might want to find HTML page elements that DO NOT contain a particular piece of text. Whatever the ultimate goal of the search, there is a version of TextComparitor and a method that will look for the right String-components. Primarily, the methods in this class are carbon-copies (function-pointers) of the static-methods inside classes StrCmpr and StrTokCmpr. This allows many variants of String and substring comparisons.

    Generally, here, one would specify a certain Inner-Tag or 'Attribute' inside an HTML 'TagNode'. Once the name of the HTML Inner-Tag has been provided - often something common-place like: 'ID', 'HREF' or possibly 'CLASS', but really anything that legally fits in an HTML TagNodeTagNode may all be queried.

    This interface has many field-references that have exactly the same function (function-pointer references) - but with different names, spellings and abbreviations. The only purpose to this is to allow for the trade-off between code-readability and easy-of-use. If you would like to write "the short-version" of the TextComparitor, then type the short version! If you think DOES_NOT_CONTAIN_CASE_INSENSITIVE really is easier to read than CN_CI_NAND, then use the field with the complete-name, rather than the abbreviated-one.

    Some of the full-versus-abbreviated field-names in this class are for the reasons listed below:

    • Name intended to hi-lite different boolean words, same/inter-changeable meaning - and for brevity.
    • Name shortened for brevity, but making for more difficult reading.
    • Name intended to hi-lite different boolean words, same/inter-changeable meaning.
    • Name changed for alternate-readability version.

    Here are some example uses of this class. For each of the examples below, presume that the variable 'page' is some instance of Vectorized-HTML.

    Example:
    // Retrieves a list of TagNode's which are HTML Anchor elements, and whose CSS "Class"
    // Attribute-Value is precisely equal to 'MyWidgets'.
    //
    // NOTE: If one of these Anchor-Elements actually has multiple CSS "class" Attribute-Values
    //       specified, the invocation below might not return your intended results!
    Vector<TagNode> anchors1 = InnerTagGet.all
        (page, "a", "class", TextComparitor.EQ_CI_TRM, "MyWidgets");
    
    // Returns all Anchor Elements whose CSS "Class" Attribute-Value has a 'MyWidgets' String-Token
    //
    // NOTE: Even if one of the Anchor's has multiple CSS classes specified (meaning that 
    //       Attribute-Value does not actually equal "MyWidgets") the intended comparison succeeds.
    Vector<TagNode> anchors1 = InnerTagGet.all
        (page, "a", "class", TextComparitor.C, "MyWidgets");
    
    // Generates a list of any/all TagNode's which are indeed HTML <A> (Anchor) elements, but whose
    // CSS 'class' Attribute-Value does not contain class 'MyWidgets'
    Vector<TagNode> anchors2 = InnerTagGet.all
        (page, "a", "class", TextComparitor.C_NAND, "MyWidgets");
    
    // This will return a list of TagNode's all of which are HTML <DIV> elements, and whose 'CLASS'
    // Attribute-Value contains at least one of the named CSS-Classes: 'MyWidgets' or 'MyPanels'
    Vector<TagNode> divs = InnerTagGet.all
        (page, "div", "class", TextComparitor.C_OR, "MyWidgets", "MyPanels");
    

    Here are more examples, these searching for TextNode instances. Make note that the purpose of having one field with name having "OR" and one without - is merely to hilite the point that inclusive-or is the default behaviour of the comparison-searches.

    Example:
    // This following four requests use different spellings of the same static-field reference.
    // The result of all four lines-of-code here produce identical results.
    // This example hopefully shows the trade-off between readability and easy-typing.
    Vector<TextNode> txt1 = TextNodeGet.all
        (page, TextComparitor.CONTAINS_CASE_INSENSITIVE, "Bob", "Xavier", "Pablo");
    
    Vector<TextNode> txt2 = TextNodeGet.all
        (page, TextComparitor.CONTAINS_CASE_INSENSITIVE_OR, "Bob", "Xavier", "Pablo");
    
    Vector<TextNode> txt3 = TextNodeGet.all
        (page, TextComparitor.CN_CI,  "Bob", "Xavier", "Pablo");
    
    Vector<TextNode> txt4 = TextNodeGet.all
        (page, TextComparitor.CN_CI_OR,  "Bob", "Xavier", "Pablo");
    
    assert txt1.equals(txt2) && txt2.equals(txt3) && txt3.equals(txt4)
    


    • Field Detail

      • serialVersionUID

        🡇     🗕  🗗  🗖
        static final long serialVersionUID
        This fulfils the SerialVersion UID requirement for all classes that implement Java's interface java.io.Serializable. Using the Serializable Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.

        Functional Interfaces are usually not thought of as Data Objects that need to be saved, stored and retrieved; however, having the ability to store intermediate results along with the lambda-functions that helped get those results can make debugging easier.
        See Also:
        Constant Field Values
        Code:
        Exact Field Declaration Expression:
         public static final long serialVersionUID = 1;
        
      • CONTAINS_CSS_CLASS_OR

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor CONTAINS_CSS_CLASS_OR
        This will check that at least one of the named/provided "Compare-String's" are present, as tokens not substrings, in the CSS-Class-String of an HTML Element.

        NOTE: All static-member fields of class TextComparitor that pertain to CSS-Classes use (Functional-Interface) test-comparisons that employ Case Sensitive Matching, and also Token Matching (as opposed to Substring Matching).

        As an example, a query asking for TagNode's having CSS CLASS=foo, with an HTML Element such as: '<DIV CLASS=foobar>' requires Token-Matching! A Token Matching Algorithm will, properly, reject this <DIV> element, which is the correct action. A simple (substring) call to cssAtribute.contains("foo") would (erroneously) accept this <DIV> element.

        A 'token' can only match the CSS Attribute CLASS=String if its match position-index inside the String has both a left and a right (preceding and succeeding) character match with one of three possible values:

        • white-space (matching '\s')
        • String-start (matching '^')
        • String-terminus (matching '$')
        See Also:
        StrTokCmpr.containsOR(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor CONTAINS_CSS_CLASS_OR = StrTokCmpr::containsOR;
        
      • CONTAINS_CSS_CLASS_AND

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor CONTAINS_CSS_CLASS_AND
        This will check that all / every-one-of the named/provided "Compare-String's" are present, as tokens not substrings, in the CSS-Class-String of an HTML Element.

        NOTE: All static-member fields of class TextComparitor that pertain to CSS-Classes use (Functional-Interface) test-comparisons that employ Case Sensitive Matching, and also Token Matching (as opposed to Substring Matching).

        As an example, a query asking for TagNode's having CSS CLASS=foo, with an HTML Element such as: '<DIV CLASS=foobar>' requires Token-Matching! A Token Matching Algorithm will, properly, reject this <DIV> element, which is the correct action. A simple (substring) call to cssAtribute.contains("foo") would (erroneously) accept this <DIV> element.

        A 'token' can only match the CSS Attribute CLASS=String if its match position-index inside the String has both a left and a right (preceding and succeeding) character match with one of three possible values:

        • white-space (matching '\s')
        • String-start (matching '^')
        • String-terminus (matching '$')
        See Also:
        StrTokCmpr.containsAND(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor CONTAINS_CSS_CLASS_AND = StrTokCmpr::containsAND;
        
      • CONTAINS_CSS_CLASS_NAND

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor CONTAINS_CSS_CLASS_NAND
        This will check that none of the named/provided "Compare-String's" are present, as tokens not substrings, in the CSS-Class-String of an HTML Element.

        NOTE: All static-member fields of class TextComparitor that pertain to CSS-Classes use (Functional-Interface) test-comparisons that employ Case Sensitive Matching, and also Token Matching (as opposed to Substring Matching).

        As an example, a query asking for TagNode's having CSS CLASS=foo, with an HTML Element such as: '<DIV CLASS=foobar>' requires Token-Matching! A Token Matching Algorithm will, properly, reject this <DIV> element, which is the correct action. A simple (substring) call to cssAtribute.contains("foo") would (erroneously) accept this <DIV> element.

        A 'token' can only match the CSS Attribute CLASS=String if its match position-index inside the String has both a left and a right (preceding and succeeding) character match with one of three possible values:

        • white-space (matching '\s')
        • String-start (matching '^')
        • String-terminus (matching '$')
        See Also:
        StrTokCmpr.containsNAND(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor CONTAINS_CSS_CLASS_NAND = StrTokCmpr::containsNAND;
        
      • CONTAINS_CSS_CLASS_XOR

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor CONTAINS_CSS_CLASS_XOR
        This will check that exactly one of the named/provided "Compare-String's" are present, as tokens not substrings, in the CSS-Class-String of an HTML Element.

        NOTE: All static-member fields of class TextComparitor that pertain to CSS-Classes use (Functional-Interface) test-comparisons that employ Case Sensitive Matching, and also Token Matching (as opposed to Substring Matching).

        As an example, a query asking for TagNode's having CSS CLASS=foo, with an HTML Element such as: '<DIV CLASS=foobar>' requires Token-Matching! A Token Matching Algorithm will, properly, reject this <DIV> element, which is the correct action. A simple (substring) call to cssAtribute.contains("foo") would (erroneously) accept this <DIV> element.

        A 'token' can only match the CSS Attribute CLASS=String if its match position-index inside the String has both a left and a right (preceding and succeeding) character match with one of three possible values:

        • white-space (matching '\s')
        • String-start (matching '^')
        • String-terminus (matching '$')
        See Also:
        StrTokCmpr.containsXOR(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor CONTAINS_CSS_CLASS_XOR = StrTokCmpr::containsXOR;
        
      • C_OR

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor C_OR
        This is used as an "abbreviation" to save typing (for convenience). It can reduce, however, readability.

        STANDARD-CSS: The standard way to look for HTML Element matches using a CSS-Selector is to use a boolean 'or', not a boolean 'and.'

        NOTE: All static-member fields of class TextComparitor that pertain to CSS-Classes use (Functional-Interface) test-comparisons that employ Case Sensitive Matching, and also Token Matching (as opposed to Substring Matching).

        As an example, a query asking for TagNode's having CSS CLASS=foo, with an HTML Element such as: '<DIV CLASS=foobar>' requires Token-Matching! A Token Matching Algorithm will, properly, reject this <DIV> element, which is the correct action. A simple (substring) call to cssAtribute.contains("foo") would (erroneously) accept this <DIV> element.

        A 'token' can only match the CSS Attribute CLASS=String if its match position-index inside the String has both a left and a right (preceding and succeeding) character match with one of three possible values:

        • white-space (matching '\s')
        • String-start (matching '^')
        • String-terminus (matching '$')
        See Also:
        CONTAINS_CSS_CLASS_OR
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor C_OR = CONTAINS_CSS_CLASS_OR;
        
      • C_AND

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor C_AND
        This is used as an "abbreviation" to save typing (for convenience). It can reduce, however, readability. Since this is Java, not a CSS-Style-Sheet, this "selector" (java.util.function.BiPredicate) allows the programmer the flexibility to build an "AND" CSS-Class-Selector, rather than an "OR" CSS-Class-Selector.

        NOTE: All static-member fields of class TextComparitor that pertain to CSS-Classes use (Functional-Interface) test-comparisons that employ Case Sensitive Matching, and also Token Matching (as opposed to Substring Matching).

        As an example, a query asking for TagNode's having CSS CLASS=foo, with an HTML Element such as: '<DIV CLASS=foobar>' requires Token-Matching! A Token Matching Algorithm will, properly, reject this <DIV> element, which is the correct action. A simple (substring) call to cssAtribute.contains("foo") would (erroneously) accept this <DIV> element.

        A 'token' can only match the CSS Attribute CLASS=String if its match position-index inside the String has both a left and a right (preceding and succeeding) character match with one of three possible values:

        • white-space (matching '\s')
        • String-start (matching '^')
        • String-terminus (matching '$')
        See Also:
        CONTAINS_CSS_CLASS_AND
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor C_AND = CONTAINS_CSS_CLASS_AND;
        
      • C_NAND

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor C_NAND
        This is just used as an "abbreviation" to save typing (for convenience). It can reduce, however, readability. Since this is Java, not a CSS-Style-Sheet, this "selector" (java.util.function.BiPredicate) allows the programmer the flexibility to build a "NAND" CSS-Class-Selector, rather than an "OR" CSS-Class-Selector.

        NOTE: All static-member fields of class TextComparitor that pertain to CSS-Classes use (Functional-Interface) test-comparisons that employ Case Sensitive Matching, and also Token Matching (as opposed to Substring Matching).

        As an example, a query asking for TagNode's having CSS CLASS=foo, with an HTML Element such as: '<DIV CLASS=foobar>' requires Token-Matching! A Token Matching Algorithm will, properly, reject this <DIV> element, which is the correct action. A simple (substring) call to cssAtribute.contains("foo") would (erroneously) accept this <DIV> element.

        A 'token' can only match the CSS Attribute CLASS=String if its match position-index inside the String has both a left and a right (preceding and succeeding) character match with one of three possible values:

        • white-space (matching '\s')
        • String-start (matching '^')
        • String-terminus (matching '$')
        See Also:
        CONTAINS_CSS_CLASS_NAND
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor C_NAND = CONTAINS_CSS_CLASS_NAND;
        
      • C_XOR

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor C_XOR
        This is just used as an "abbreviation" to save typing (for convenience). It can reduce, however, readability. Since this is Java, not a CSS-Style-Sheet, this "selector" (java.util.function.BiPredicate) allows the programmer the flexibility to build an "XOR" CSS-Class-Selector, rather than an "OR" CSS-Class-Selector.

        NOTE: All static-member fields of class TextComparitor that pertain to CSS-Classes use (Functional-Interface) test-comparisons that employ Case Sensitive Matching, and also Token Matching (as opposed to Substring Matching).

        As an example, a query asking for TagNode's having CSS CLASS=foo, with an HTML Element such as: '<DIV CLASS=foobar>' requires Token-Matching! A Token Matching Algorithm will, properly, reject this <DIV> element, which is the correct action. A simple (substring) call to cssAtribute.contains("foo") would (erroneously) accept this <DIV> element.

        A 'token' can only match the CSS Attribute CLASS=String if its match position-index inside the String has both a left and a right (preceding and succeeding) character match with one of three possible values:

        • white-space (matching '\s')
        • String-start (matching '^')
        • String-terminus (matching '$')
        See Also:
        CONTAINS_CSS_CLASS_XOR
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor C_XOR = CONTAINS_CSS_CLASS_XOR;
        
      • C

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor C
        This is used as an EXTRA "abbreviation" to save typing (for convenience). It can reduce, however, readability.

        STANDARD-CSS: The standard way to look for HTML Element matches using a CSS-Selector is to use a boolean 'or', not a boolean 'and'.

        ALSO: CSS Classes are not case insensitive.

        NOTE: All static-member fields of class TextComparitor that pertain to CSS-Classes use (Functional-Interface) test-comparisons that employ Case Sensitive Matching, and also Token Matching (as opposed to Substring Matching).

        As an example, a query asking for TagNode's having CSS CLASS=foo, with an HTML Element such as: '<DIV CLASS=foobar>' requires Token-Matching! A Token Matching Algorithm will, properly, reject this <DIV> element, which is the correct action. A simple (substring) call to cssAtribute.contains("foo") would (erroneously) accept this <DIV> element.

        A 'token' can only match the CSS Attribute CLASS=String if its match position-index inside the String has both a left and a right (preceding and succeeding) character match with one of three possible values:

        • white-space (matching '\s')
        • String-start (matching '^')
        • String-terminus (matching '$')
        See Also:
        C_OR, CONTAINS_CSS_CLASS_OR
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor C = C_OR;
        
      • EQ

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EQ
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If precisely one of the compare-String's equal the attribute-value or TextNode, then and only then will this BiPredicate return TRUE.
        See Also:
        StrCmpr.equalsXOR(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EQ = StrCmpr::equalsXOR;
        
      • NOT_EQ

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor NOT_EQ
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If and only if none of the candidates are equal, can this BiPredicate evaluate to TRUE.
        See Also:
        StrCmpr.equalsNAND(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor NOT_EQ = StrCmpr::equalsNAND;
        
      • EQ_NAND

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EQ_NAND
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If and only if none of the candidates are equal, can this BiPredicate evaluate to TRUE. This function-pointer is identical to the one named NOT_EQ.
        See Also:
        StrCmpr.equalsNAND(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EQ_NAND = StrCmpr::equalsNAND;
        
      • EQ_CASE_INSENSITIVE

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EQ_CASE_INSENSITIVE
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If precisely one of the compare-String's equal the attribute-value or TextNode, then and only then will this BiPredicate return TRUE. In this function-pointer, the comparison performed will ignore the case of the arguments.
        See Also:
        StrCmpr.equalsXOR_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EQ_CASE_INSENSITIVE = StrCmpr::equalsXOR_CI;
        
      • EQ_CI

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EQ_CI
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If precisely one of the compare-String's equal the attribute-value or TextNode, then and only then will this BiPredicate return TRUE. In this function-pointer, the comparison performed will ignore the case of the arguments. This is an abbreviated version of the identical TextComparitor EQ_CASE_INSENSITIVE.
        See Also:
        StrCmpr.equalsXOR_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EQ_CI = StrCmpr::equalsXOR_CI;
        
      • NOT_EQ_CASE_INSENSITIVE

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor NOT_EQ_CASE_INSENSITIVE
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If and only if none of the candidates are equal, can this BiPredicate evaluate to TRUE. In this function-pointer, the comparison performed will ignore the case of the arguments.
        See Also:
        StrCmpr.equalsNAND_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor NOT_EQ_CASE_INSENSITIVE = StrCmpr::equalsNAND_CI;
        
      • NOT_EQ_CI

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor NOT_EQ_CI
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If and only if none of the candidates are equal, can this BiPredicate evaluate to TRUE. In this function-pointer, the comparison performed will ignore the case of the arguments. This is an abbreviated version of the identical TextComparitor NOT_EQ_CASE_INSENSITIVE.
        See Also:
        StrCmpr.equalsNAND_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor NOT_EQ_CI = StrCmpr::equalsNAND_CI;
        
      • EQ_CI_NAND

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EQ_CI_NAND
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If and only if none of the candidates are equal, can this BiPredicate evaluate to TRUE. In this function-pointer, the comparison performed will ignore the case of the arguments. This is an abbreviated version of the identical TextComparitor NOT_EQ_CASE_INSENSITIVE.
        See Also:
        StrCmpr.equalsNAND_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EQ_CI_NAND = StrCmpr::equalsNAND_CI;
        
      • EQ_TRM

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EQ_TRM
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If precisely one of the compare-String's equal the attribute-value or TextNode, then and only then will this BiPredicate return TRUE. Before the equality-comparison is performed, the java.lang.String.trim() method will be invoked on the attribute-value or TextNode.
        See Also:
        StrCmpr.equalsXOR(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EQ_TRM =
                 (String s, String[] sArr) -> StrCmpr.equalsXOR(s.trim(), sArr);
        
      • NOT_EQ_TRM

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor NOT_EQ_TRM
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If and only if none of the candidates are equal, can this BiPredicate evaluate to TRUE. Before the equality-comparison is performed, the java.lang.String.trim() method will be invoked on the attribute-value or TextNode.
        See Also:
        StrCmpr.equalsNAND(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor NOT_EQ_TRM = 
                 (String s, String[] sArr) -> StrCmpr.equalsNAND(s.trim(), sArr);
        
      • EQ_NAND_TRM

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EQ_NAND_TRM
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If and only if none of the candidates are equal, can this BiPredicate evaluate to TRUE. This function-pointer is identical to the one named NOT_EQ. Before the equality-comparison is performed, the java.lang.String.trim() method will be invoked on the attribute-value or TextNode.
        See Also:
        StrCmpr.equalsNAND(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EQ_NAND_TRM = 
                 (String s, String[] sArr) -> StrCmpr.equalsNAND(s.trim(), sArr);
        
      • EQ_CASE_INSENSITIVE_TRIM

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EQ_CASE_INSENSITIVE_TRIM
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If precisely one of the compare-String's equal the attribute-value or TextNode, then and only then will this BiPredicate return TRUE. In this function-pointer, the comparison performed will ignore the case of the arguments. Before the equality-comparison is performed, the java.lang.String.trim() method will be invoked on the attribute-value or TextNode.
        See Also:
        StrCmpr.equalsXOR_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EQ_CASE_INSENSITIVE_TRIM = 
                 (String s, String[] sArr) -> StrCmpr.equalsXOR_CI(s.trim(), sArr);
        
      • EQ_CI_TRM

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EQ_CI_TRM
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If precisely one of the compare-String's equal the attribute-value or TextNode, then and only then will this BiPredicate return TRUE. In this function-pointer, the comparison performed will ignore the case of the arguments. This is an abbreviated version of the identical TextComparitor EQ_CASE_INSENSITIVE_TRIM. Before the equality-comparison is performed, the java.lang.String.trim() method will be invoked on the attribute-value or TextNode.
        See Also:
        StrCmpr.equalsXOR_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EQ_CI_TRM = 
                 (String s, String[] sArr) -> StrCmpr.equalsXOR_CI(s.trim(), sArr);
        
      • NOT_EQ_CASE_INSENSITIVE_TRIM

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor NOT_EQ_CASE_INSENSITIVE_TRIM
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If and only if none of the candidates are equal, can this BiPredicate evaluate to TRUE. In this function-pointer, the comparison performed will ignore the case of the arguments. Before the equality-comparison is performed, the java.lang.String.trim() method will be invoked on the attribute-value or TextNode.
        See Also:
        StrCmpr.equalsNAND_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor NOT_EQ_CASE_INSENSITIVE_TRIM = 
                 (String s, String[] sArr) -> StrCmpr.equalsNAND_CI(s.trim(), sArr);
        
      • NOT_EQ_CI_TRM

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor NOT_EQ_CI_TRM
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If and only if none of the candidates are equal, can this BiPredicate evaluate to TRUE. In this function-pointer, the comparison performed will ignore the case of the arguments. This is an abbreviated version of the identical TextComparitor NOT_EQ_CASE_INSENSITIVE_TRIM. Before the equality-comparison is performed, the java.lang.String.trim() method will be invoked on the attribute-value or TextNode.
        See Also:
        StrCmpr.equalsNAND_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor NOT_EQ_CI_TRM = 
                 (String s, String[] sArr) -> StrCmpr.equalsNAND_CI(s.trim(), sArr);
        
      • EQ_CI_NAND_TRM

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EQ_CI_NAND_TRM
        Will compare an attribute-value String, or TextNode for equality against a list of possible String-match candidates. If and only if none of the candidates are equal, can this BiPredicate evaluate to TRUE. In this function-pointer, the comparison performed will ignore the case of the arguments. Before the equality-comparison is performed, the java.lang.String.trim() method will be invoked on the attribute-value or TextNode.
        See Also:
        StrCmpr.equalsNAND_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EQ_CI_NAND_TRM = 
                 (String s, String[] sArr) -> StrCmpr.equalsNAND_CI(s.trim(), sArr);
        
      • CN_XOR

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor CN_XOR
        Checks an attribute-value or TextNode to identify if it will match precisely one and only one String from a list of compare-String's. This field instance has an abbreviated name (for convenience), but identical function-pointer to CONTAINS_XOR.
        See Also:
        StrCmpr.containsXOR(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor CN_XOR = StrCmpr::containsXOR;
        
      • CONTAINS_CASE_INSENSITIVE

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor CONTAINS_CASE_INSENSITIVE
        Similar to public static field CONTAINS, this function-pointer checks an attribute-value or TextNode to identify whether it contains at least one match out of a list compare-String's. The difference between this field and the aforementioned public static field is that this one ('CONTAINS_CASE_INSENSITIVE') ignores the case of the lettering when performing the String comparisons.
        See Also:
        StrCmpr.containsOR_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor CONTAINS_CASE_INSENSITIVE = StrCmpr::containsOR_CI;
        
      • CONTAINS_CASE_INSENSITIVE_AND

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor CONTAINS_CASE_INSENSITIVE_AND
        Just like public static field CONTAINS_AND, this function-pointer checks an attribute-value or TextNode to identify whether it contains a match for every string in the list compare-String's. The difference between this field and the aforementioned public static field is that this one ('CONTAINS_CASE_INSENSITIVE_AND') ignores the case of the lettering when performing the String comparisons.
        See Also:
        StrCmpr.containsAND_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor CONTAINS_CASE_INSENSITIVE_AND = StrCmpr::containsAND_CI;
        
      • CONTAINS_CASE_INSENSITIVE_XOR

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor CONTAINS_CASE_INSENSITIVE_XOR
        Similar to public static field CONTAINS_XOR, this function-pointer checks an attribute-value or TextNode to identify if it will match precisely one and only one String from a list of compare-String's. The difference between this field and the aforementioned public static field is that this one ('CONTAINS_CASE_INSENSITIVE_XOR') ignores the case of the lettering when performing the String comparisons.
        See Also:
        StrCmpr.containsXOR_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor CONTAINS_CASE_INSENSITIVE_XOR = StrCmpr::containsXOR_CI;
        
      • CONTAINS_CASE_INSENSITIVE_NAND

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor CONTAINS_CASE_INSENSITIVE_NAND
        Just like public static field CONTAINS_NAND, this function pointer checks an attribute-value or TextNode to ensure that it does not contain any matches with the list of compare-String's. The difference between this field and the aforementioned public static field is that this one ('CONTAINS_CASE_INSENSITIVE_NAND') ignores the case of the lettering when performing the String comparisons.
        See Also:
        StrCmpr.containsNAND_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor CONTAINS_CASE_INSENSITIVE_NAND = StrCmpr::containsNAND_CI;
        
      • CONTAINS_CASE_INSENSITIVE_OR

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor CONTAINS_CASE_INSENSITIVE_OR
        Similar to public static field CONTAINS_OR, this function-pointer checks an attribute-value or TextNode to identify whether it contains at least one match out of a list of compare-String's. The difference between this field and the aforementioned public static field is that this one ('CONTAINS_CASE_INSENSITIVE_OR') ignores the case of the lettering when performing the String comparisons.
        See Also:
        StrCmpr.containsOR_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor CONTAINS_CASE_INSENSITIVE_OR = StrCmpr::containsOR_CI;
        
      • STARTS_WITH

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor STARTS_WITH
        Checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the initial characters (the 'start' of the source-String) will match with precisely one of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.startsWithXOR(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor STARTS_WITH = StrCmpr::startsWithXOR;
        
      • DOES_NOT_START_WITH

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor DOES_NOT_START_WITH
        Checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the initial characters (the 'start' of the source-String) will not match with any of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.startsWithNAND(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor DOES_NOT_START_WITH = StrCmpr::startsWithNAND;
        
      • STARTS_WITH_CASE_INSENSITIVE

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor STARTS_WITH_CASE_INSENSITIVE
        Nearly identical to STARTS_WITH, but here the function-pointer points to a method that ignores case when performing the comparisons. This public static field checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the initial characters (the 'start' of the source-String) will match with precisely one of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.startsWithXOR_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor STARTS_WITH_CASE_INSENSITIVE = StrCmpr::startsWithXOR_CI;
        
      • DOES_NOT_START_WITH_CASE_INSENSITIVE

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor DOES_NOT_START_WITH_CASE_INSENSITIVE
        Nearly identical to DOES_NOT_START_WITH, but here the function-pointer points to a method that ignores case when performing the comparisons. This public static field checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the initial characters (the 'start' of the source-String) will not match with any of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.startsWithNAND_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor DOES_NOT_START_WITH_CASE_INSENSITIVE = 
                 StrCmpr::startsWithNAND_CI;
        
      • SW

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor SW
        A static, function-pointer, field with an abbreviated name identical to field STARTS_WITH.

        Checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the initial characters (the 'start' of the source-String) will match with precisely one of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.startsWithXOR(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor SW = StrCmpr::startsWithXOR;
        
      • SW_CI

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor SW_CI
        A static, function-pointer, field with an abbreviated name identical to field STARTS_WITH_CASE_INSENSITIVE.

        Nearly identical to STARTS_WITH, but here the function-pointer points to a method that ignores case when performing the comparisons. This public static field checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the initial characters (the 'start' of the source-String) will match with precisely one of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.startsWithXOR_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor SW_CI = StrCmpr::startsWithXOR_CI;
        
      • SW_TRM

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor SW_TRM
        Invokes java.lang.String.trim() on the first input-parameter; although the remainder of this BiPredicate<String, String[] is identical to public static field SW.
        See Also:
        StrCmpr.startsWithXOR(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor SW_TRM =
                 (String s, String[] sArr) -> StrCmpr.startsWithXOR(s.trim(), sArr);
        
      • ENDS_WITH

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor ENDS_WITH
        Checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the ending characters (the 'tail' of the source-String) will match with precisely one of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.endsWithXOR(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor ENDS_WITH = StrCmpr::endsWithXOR;
        
      • DOES_NOT_END_WITH

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor DOES_NOT_END_WITH
        Checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the ending characters (the 'tail' of the source-String) will not match with any of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.endsWithNAND(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor DOES_NOT_END_WITH = StrCmpr::endsWithNAND;
        
      • ENDS_WITH_CASE_INSENSITIVE

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor ENDS_WITH_CASE_INSENSITIVE
        Nearly identical to ENDS_WITH, but here the function-pointer points to a method that ignores case when performing the comparisons. This public static field checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the ending characters (the 'tail' of the source-String) will match with precisely one of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.endsWithXOR_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor ENDS_WITH_CASE_INSENSITIVE = StrCmpr::endsWithXOR_CI;
        
      • DOES_NOT_END_WITH_CASE_INSENSITIVE

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor DOES_NOT_END_WITH_CASE_INSENSITIVE
        Nearly identical to DOES_NOT_END_WITH, but here the function-pointer points to a method that ignores case when performing the comparisons. This public static field checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the ending characters (the 'tail' of the source-String) will not match with any of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.endsWithNAND_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor DOES_NOT_END_WITH_CASE_INSENSITIVE = 
                 StrCmpr::endsWithNAND_CI;
        
      • EW

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EW
        A static, function-pointer, field with an abbreviated name identical to field ENDS_WITH.

        Checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the ending characters (the 'tail' of the source-String) will match with precisely one of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.endsWithXOR(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EW = StrCmpr::endsWithXOR;
        
      • EW_CI

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EW_CI
        A static, function-pointer, field with an abbreviated name identical to field ENDS_WITH_CASE_INSENSITIVE.

        Nearly identical to ENDS_WITH, but here the function-pointer points to a method that ignores case when performing the comparisons. This public static field checks an input 'source String' (usually an inner-tag value or a TextNode) to verify that the ending characters (the 'tail' of the source-String) will match with precisely one of the java var-args String... compare-String's list.
        See Also:
        StrCmpr.endsWithXOR_CI(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EW_CI = StrCmpr::endsWithXOR_CI;
        
      • EW_TRM

        🡅  🡇     🗕  🗗  🗖
        static final TextComparitor EW_TRM
        Invokes java.lang.String.trim() on the first input-parameter; although the remainder of this BiPredicate<String, String[] is identical to public static field EW.
        See Also:
        EW, StrCmpr.endsWithXOR(String, String[])
        Code:
        Exact Field Declaration Expression:
         public static final TextComparitor EW_TRM = 
                 (String s, String[] sArr) -> StrCmpr.endsWithXOR(s.trim(), sArr);
        
    • Method Detail

      • test

        🡅  🡇     🗕  🗗  🗖
        boolean test​(java.lang.String str,
                     java.lang.String[] compareText)
        FunctionalInterface Target-Method:
        This method corresponds to the @FunctionalInterface Annotation's method requirement. It is the only non-default, non-static method in this interface, and may be the target of a Lambda-Expression or '::' (double-colon) Function-Pointer.
        Specified by:
        test in interface java.util.function.BiPredicate<java.lang.String,​java.lang.String[]>
        Parameters:
        str - This is usually a line of text from the public final String str field of the class TextNode, if the programmer is requesting a TextNode search. If the search being performed is on TagNode attribute values, then the value of parameter String htmlText will be any String-text within an HTML Element's attribute value.
        compareText - This is a list of different text-String's to be used by the method that performs the test. View the compare-String's in the methods of classes StrCmpr or StrTokCmpr to understand this more clearly.
        Returns:
        After performing the single-input-parameter "version of" the accept(htmlText, compareText) method on as many of the elements of the String[] compareText input-array, this will return TRUE or FALSE dependent on the expected boolean-logic behavior of the comparison. This is simple, as the four primary boolean operations: AND, OR, NAND, XOR are provided as pre-defined methods here.

        NOTE: All boolean evaluations done are short-circuit evaluations. As soon as a function result-value is known, it will be returned.
        ALSO: Loops begin with the first element of the String[] compareText array, and stop with the last element.
      • getName

        🡅     🗕  🗗  🗖
        static java.lang.String getName​(TextComparitor tc)
        Helper / Convenience Method. In almost all cases, this will return the actual field / variable name of an instance of TextComparitor. The lookup method uses Java Reflection. Internal exception & error reporting logic makes use of this method (where it works properly), but if this method is invoked on a user-supplied TextComparitor, ths method will not be able to 'guess' the variable or field name from whence that instance was derived or created.

        USE: For EQ_CASE_INSENSITIVE, this method returns the Java String "EQ_CASE_INSENSITIVE".

        AGAIN:There are certain cases where this method will fail. The test performed here uses a reference-equality comparison. For instance, if the user requests the name of a "Serialized Version" of a TextComparitor, then the instance-reference loaded from a Serialized Object File, and the instance-reference stored inside this class would be different. If, indeed, there were two instances of 'TextComparitor.STARTS_WITH' then the serialized version of 'TextComparitor.STARTS_WITH' (when invoking this method) would not properly return the String 'STARTS_WITH'

        PRIMARILY: This method is used by one of the exception reporting mechanisms, and therefore neither relies nor requires serialized, saved, or user-created TextComparitor's. For those purposes, retreiving the static field-name of the TextComparitor's that are passed here will work fine.

        AGAIN: This method is used internally for error-reporting.
        Parameters:
        tc - An instance of this class, TextComparitor, which is a also a static field member of this class.
        Returns:
        If the reference provided is one of the static fields which are defined inside TextComparitor, then the name of that field, as a java.lang.String, will be returned. If this is a user-defined TextComparitor, then it's name will not be found, and 'null' shall be returned instead.

        Example:
         System.out.println(TextComparitor.getName(TextComparitor.EQ));
         
         // Prints the String: "EQ"
        
        Code:
        Exact Method Body:
         Field[] fArr = TextComparitor.class.getDeclaredFields();
        
         try
             { for (Field f : fArr) if (f.get(null) == tc) return f.getName(); }
        
         catch (IllegalAccessException e)
             { return null; }
        
         return null;