Package Torello.Java
Class StrCmpr
- java.lang.Object
-
- Torello.Java.StrCmpr
-
public class StrCmpr extends java.lang.Object
Class String-Compare provides an exhaustive-combinatoric suite of methods that extend the basic JavaStringmethodsequals, contains, startsWithandendsWith.
This class offers an API that has a large collection of comparison routines for ajava.lang.String.
Obviously, Regular-Expressions will always be capable of providing the most powerful String-Search and manipulations routines. However, with the extra level of control that a Regular-Expression offers comes some extra-amount of complexity. The routines inclass StrCmprandclass StrIndexOfcan eliminatefor-loopsand all the debugging that comes along with them - saving programmers countless hours of when their programs need only simple comparisons and searches that can be written without a RegEx.
The methods in this class usesubstringcomparison-logic, rather thantokencompares - meaning that the loops are checking only the characters within input parameter(s)comparStr. The characters before and after a match are ignored.
Example:
boolean result = StrCmpr.containsXOR_CI("Visited in August of this year." "july", "august"); // Evaluates to TRUE boolean result = StrCmpr.containsXOR_CI("Traveled to Beijing last year.", "july", "august"); // Evaluates to FALSE
Methods Available
Method-Name Key-Word Explanation NAND May not find any matches between the primary String srcStrparameter, and theString'spassed to'compareStr'
NAND-NOTE: There is one very important subtlety about the meaning of'NAND'here. In this case, the methods that use'NAND'interpret its meaning as "NOT ANY ONE OF..." - meaning all comparisons must fail.XOR Must find precisely one match between the primary String srcStrparameter, and theString'sin'compareStr'.
There is one 'philosophical note' which is that if multiple copies of an identical-Stringare passed via the comparison-Stringarray (String... comparestr), all XOR methods shall not pay heed to the notion that they the'srcStr'parmeter may have only started-with, ended-with or contained a singleString(and 'philosophically passing' the XOR, one-and-only-one test). The internal-logical is 'programmatically ignorant' of this - multiple copies of an identical-String(or identical, ignoring-case) could theoretically be flagged via throwing anIllegalArgumentException. However, no such check is performed.OR Must find at least one match between the primary String srcStrparameter, and theString'sin the'compareStr'parameter.AND Must identify a containing-match between each and every StringinString... compareStrand the primary'srcStr'parameter.Starts With The provided compare-String(orString's) must match the beginning of parameter'srcStr'.Ends With The provided compare-String(orString's) must match the ending of parameter'srcStr'.Contains The provided compare-String(orString's) must be a substring of parameter'srcStr'.CI (Case Insensitive) All equality-tests will be done on a Case Insensitivebasis.
Hi-Lited Source-Code:- View Here: Torello/Java/StrCmpr.java
- Open New Browser-Tab: Torello/Java/StrCmpr.java
File Size: 54,414 Bytes Line Count: 1,094 '\n' Characters Found
Stateless Class:This class neither contains any program-state, nor can it be instantiated. The@StaticFunctionalAnnotation may also be called 'The Spaghetti Report'.Static-Functionalclasses are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's@StatelessAnnotation.
- 1 Constructor(s), 1 declared private, zero-argument constructor
- 56 Method(s), 56 declared static
- 6 Field(s), 6 declared static, 4 declared final
- Fields excused from final modifier (with explanation):
Field 'DEBUG' is not final. Reason: DEBUGGING Field 'DEBUG_LOG' is not final. Reason: DEBUGGING
-
-
Method Summary
Equals Modifier and Type Method static booleanequalsNAND(String srcStr, String... compareStr)static booleanequalsXOR(String srcStr, String... compareStr)Equals: Ⅰ Range-Limited Modifier and Type Method static booleanequals(String srcStr, int sPos, int ePos, String compareStr)static booleanequalsNAND(String srcStr, int sPos, int ePos, String... compareStr)static booleanequalsXOR(String srcStr, int sPos, int ePos, String... compareStr)Equals: Ⅱ Case-Insensitive Modifier and Type Method static booleanequalsNAND_CI(String srcStr, String... compareStr)static booleanequalsXOR_CI(String srcStr, String... compareStr)Equals: Ⅰ Range-Limited Ⅱ Case-Insensitive Modifier and Type Method static booleanequalsIgnoreCase(String srcStr, int sPos, int ePos, String compareStr)static booleanequalsNAND_CI(String srcStr, int sPos, int ePos, String... compareStr)static booleanequalsXOR_CI(String srcStr, int sPos, int ePos, String... compareStr)Contains Modifier and Type Method static booleancontainsAND(String srcStr, String... compareStr)static booleancontainsNAND(String srcStr, String... compareStr)static booleancontainsOR(String srcStr, String... compareStr)static booleancontainsXOR(String srcStr, String... compareStr)Contains: Ⅰ Range-Limited Modifier and Type Method static booleancontains(String srcStr, int sPos, int ePos, String compareStr)static booleancontainsAND(String srcStr, int sPos, int ePos, String... compareStr)static booleancontainsNAND(String srcStr, int sPos, int ePos, String... compareStr)static booleancontainsOR(String srcStr, int sPos, int ePos, String... compareStr)static booleancontainsXOR(String srcStr, int sPos, int ePos, String... compareStr)Contains: Ⅱ Case-Insensitive Modifier and Type Method static booleancontainsAND_CI(String srcStr, String... compareStr)static booleancontainsIgnoreCase(String srcStr, String compareStr)static booleancontainsNAND_CI(String srcStr, String... compareStr)static booleancontainsOR_CI(String srcStr, String... compareStr)static booleancontainsXOR_CI(String srcStr, String... compareStr)Contains: Ⅰ Range-Limited Ⅱ Case-Insensitive Modifier and Type Method static booleancontainsAND_CI(String srcStr, int sPos, int ePos, String... compareStr)static booleancontainsIgnoreCase(String srcStr, int sPos, int ePos, String compareStr)static booleancontainsNAND_CI(String srcStr, int sPos, int ePos, String... compareStr)static booleancontainsOR_CI(String srcStr, int sPos, int ePos, String... compareStr)static booleancontainsXOR_CI(String srcStr, int sPos, int ePos, String... compareStr)Starts-With Modifier and Type Method static booleanstartsWithNAND(String srcStr, String... compareStr)static booleanstartsWithXOR(String srcStr, String... compareStr)Starts-With: Ⅰ Range-Limited Modifier and Type Method static booleanstartsWith(String srcStr, int sPos, int ePos, String compareStr)static booleanstartsWithNAND(String srcStr, int sPos, int ePos, String... compareStr)static booleanstartsWithXOR(String srcStr, int sPos, int ePos, String... compareStr)Starts-With: Ⅱ Case-Insensitive Modifier and Type Method static booleanstartsWithIgnoreCase(String srcStr, String compareStr)static booleanstartsWithNAND_CI(String srcStr, String... compareStr)static booleanstartsWithXOR_CI(String srcStr, String... compareStr)Starts-With: Ⅰ Range-Limited Ⅱ Case-Insensitive Modifier and Type Method static booleanstartsWithIgnoreCase(String srcStr, int sPos, int ePos, String compareStr)static booleanstartsWithNAND_CI(String srcStr, int sPos, int ePos, String... compareStr)static booleanstartsWithXOR_CI(String srcStr, int sPos, int ePos, String... compareStr)Ends-With Modifier and Type Method static booleanendsWithNAND(String srcStr, String... compareStr)static booleanendsWithXOR(String srcStr, String... compareStr)Ends-With: Ⅰ Range-Limited Modifier and Type Method static booleanendsWith(String srcStr, int sPos, int ePos, String compareStr)static booleanendsWithNAND(String srcStr, int sPos, int ePos, String... compareStr)static booleanendsWithXOR(String srcStr, int sPos, int ePos, String... compareStr)Ends-With: Ⅱ Case-Insensitive Modifier and Type Method static booleanendsWithIgnoreCase(String srcStr, String compareStr)static booleanendsWithNAND_CI(String srcStr, String... compareStr)static booleanendsWithXOR_CI(String srcStr, String... compareStr)Ends-With: Ⅰ Range-Limited Ⅱ Case-Insensitive Modifier and Type Method static booleanendsWithIgnoreCase(String srcStr, int sPos, int ePos, String compareStr)static booleanendsWithNAND_CI(String srcStr, int sPos, int ePos, String... compareStr)static booleanendsWithXOR_CI(String srcStr, int sPos, int ePos, String... compareStr)Internal, Protected Helper Methods Modifier and Type Method protected static booleanAND(String methodName, String srcStr, String[] compareStr, Predicate<String> pred)protected static booleanNAND(String methodName, String srcStr, String[] compareStr, Predicate<String> pred)protected static booleanOR(String methodName, String srcStr, String[] compareStr, Predicate<String> pred)protected static booleanXOR(String methodName, String srcStr, String[] compareStr, Predicate<String> pred)
-
-
-
Field Detail
-
DEBUG
public static boolean DEBUG
Utility field. You may choose to set this variable to true, and the followingStringcommands will print to an internally storedConsumer<String> DEBUG_LOGclass that may be set. This is generally a very minor drain on code-efficiency. When this flag is set toFALSE, a shortif-statement evaluationstill occurs even when the flag is false on each occasion that the string-comparison loops identify and return a match. This is very minor performance loss, and does provide quite a lot of help to those trying to identify difficult to notice problems with partial-Stringcomparisons.
Required Setting:
In order to use this minor Debugging Feature, it is necessary to provide aConsumer<String>to public fieldDEBUG_LOG! This field is apublicandstaticfield, which will be used by any invocation of the methods in this class. ThisString-consumer may do anything you would like it to do with the provided Debug-Stringdata.
String-Format:
TheStringthat is ultimately sent to theConsumer<String>you provide will be formatted, as below, in the following Code-Snippet:
private static void PRNT(String methodName, String srcStr, String compareStr) { DEBUG_LOG.accept(methodName + "-MATCH[" + srcStr + ", " + compareStr + "] "); }
Generally, you would assign a writer that looks like something the Lambda-Target / Function-Pointer assignment in the snippet below:
StrCmpr.DEBUG_LOG = (String logInfoStr) -> System.out.println(logInfoStr);
Finally, if you are using this field, please note that any of the methods whose name ends with the phrase "IgnoreCase" will not print to theDEBUG_LOG. This is primarily because these are all single-argument comparisons, and logging would be of only minor benefit.
The primary value of a debug-log is the ability to identify whether / when a particular substring from a list of substrings actually matched.- Code:
- Exact Field Declaration Expression:
public static boolean DEBUG = false;
-
DEBUG_LOG
public static java.util.function.Consumer<java.lang.String> DEBUG_LOG
This object reference cannot remain null when the fieldDEBUGis set toTRUE. If you have turnedDEBUGon (by setting the field toTRUE), and this is null, then aNullPointerExceptionwill be thrown on the very next invocation of any of the methods in this class.
DEBUG_LOG is not Thread-Safe:
No attempt has been made to ensure that this debugging "feature" will operate perfectly in a multi-threaded environment. The two reasons for this are:- The primary purpose of this LOG is for debugging code, not putting details about
string-match information into an 'on-line' or production environment.
- This is a best-efforts string-comparison package that would sacrifice quite a bit of its
utility if it were expected to maintain multiple instances of this class just to have
StrCmprdebug operations work in multiple-threads. Code readability necessitates keeping this a class with only static methods.
- Two threads making calls to this class
StrCmprmight see log-writes that, sadly, look like they 'interlaced' (crashed), but even when this occasions, reading the log wouldn't be that difficult anyway.
- Code:
- Exact Field Declaration Expression:
public static Consumer<String> DEBUG_LOG = null;
- The primary purpose of this LOG is for debugging code, not putting details about
string-match information into an 'on-line' or production environment.
-
AND
protected static final byte AND
Signifies that an'AND'operation is required, but only for methods that implement one of the'contains'variants.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final byte AND = 0;
-
OR
protected static final byte OR
Signifies that an'AND'operation is required, but only for methods that implement one of the'contains'variants.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final byte OR = 1;
-
NAND
protected static final byte NAND
Signifies that an'AND'operation is required, but only for methods that implement one of the'contains'variants.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final byte NAND = 2;
-
XOR
protected static final byte XOR
Signifies that an'AND'operation is required, but only for methods that implement one of the'contains'variants.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final byte XOR = 3;
-
-
Method Detail
-
AND
protected static boolean AND (java.lang.String methodName, java.lang.String srcStr, java.lang.String[] compareStr, java.util.function.Predicate<java.lang.String> pred)
This performs the internal AND. It expects a comparisonPredicatein order for the comparison to work.- Parameters:
methodName- If printing-debug information is expected, by the DEBUG global-variable, thisStringis used.srcStr- This is the same source-string parameter from all the methods in this class.compareStr- This is the same var-args string array from all the methods in this class.pred- This is the comparisonPredicateprovided by the methods in this class that call this method.- Returns:
- The AND of these
String's, using the providedPredicate. - Throws:
StrCmprException- This exception shall throw if there are any invalidString'sin the compare-string parameter array.Note: The conditions that would cause this exception to throw should remind the reader that each and every method here will throw exception'StrCmprException'if invalid input has been passed to the "Compare String" Variable-ArgumentsString...Parameter.- Code:
- Exact Method Body:
StrCmprException.check(compareStr); for (String cmp: compareStr) if (! pred.test(cmp)) { if (DEBUG) PRNT(methodName + "-MATCHFAIL", srcStr, cmp); return false; } return true;
-
NAND
protected static boolean NAND (java.lang.String methodName, java.lang.String srcStr, java.lang.String[] compareStr, java.util.function.Predicate<java.lang.String> pred)
This performs the internal NAND. It expects a comparisonPredicatein order for the comparison to work.- Parameters:
methodName- If printing-debug information is expected, by the DEBUG global-variable, thisStringis used.srcStr- This is the same source-string parameter from all the methods in this class.compareStr- This is the same var-args string array from all the methods in this class.pred- This is the comparisonPredicateprovided by the methods in this class that call this method.- Returns:
- The NAND of these
String's, using the providedPredicate. - Throws:
StrCmprException- This exception shall throw if there are any invalidString'sin the compare-string parameter array.Note: The conditions that would cause this exception to throw should remind the reader that each and every method here will throw exception'StrCmprException'if invalid input has been passed to the "Compare String" Variable-ArgumentsString...Parameter.- Code:
- Exact Method Body:
StrCmprException.check(compareStr); for (String cmp: compareStr) if (pred.test(cmp)) { if (DEBUG) PRNT(methodName + "-MATCH", srcStr, cmp); return false; } return true;
-
OR
protected static boolean OR (java.lang.String methodName, java.lang.String srcStr, java.lang.String[] compareStr, java.util.function.Predicate<java.lang.String> pred)
This performs the internal OR. It expects a comparisonPredicatein order for the comparison to work.- Parameters:
methodName- If printing-debug information is expected, by the DEBUG global-variable, thisStringis used.srcStr- This is the same source-string parameter from all the methods in this class.compareStr- This is the same var-args string array from all the methods in this class.pred- This is the comparisonPredicateprovided by the methods in this class that call this method.- Returns:
- The OR of these
String's, using the providedPredicate. - Throws:
StrCmprException- This exception shall throw if there are any invalidString'sin the compare-string parameter array.Note: The conditions that would cause this exception to throw should remind the reader that each and every method here will throw exception'StrCmprException'if invalid input has been passed to the "Compare String" Variable-ArgumentsString...Parameter.- Code:
- Exact Method Body:
StrCmprException.check(compareStr); for (String cmp: compareStr) if (pred.test(cmp)) { if (DEBUG) PRNT(methodName + "-MATCH", srcStr, cmp); return true; } return false;
-
XOR
protected static boolean XOR (java.lang.String methodName, java.lang.String srcStr, java.lang.String[] compareStr, java.util.function.Predicate<java.lang.String> pred)
This performs the internal XOR. It expects a comparisonPredicatein order for the comparison to work.- Parameters:
methodName- If printing-debug information is expected, by the DEBUG global-variable, thisStringis used.srcStr- This is the same source-string parameter from all the methods in this class.compareStr- This is the same var-args string array from all the methods in this class.pred- This is the comparisonPredicateprovided by the methods in this class that call this method.- Returns:
- The XOR of these
String's, using the providedPredicate. - Throws:
StrCmprException- This exception shall throw if there are any invalidString'sin the compare-string parameter array.Note: The conditions that would cause this exception to throw should remind the reader that each and every method here will throw exception'StrCmprException'if invalid input has been passed to the "Compare String" Variable-ArgumentsString...Parameter.- Code:
- Exact Method Body:
StrCmprException.check(compareStr); int count=0; for (String cmp: compareStr) if (pred.test(cmp)) if (++count > 1) { if (DEBUG) PRNT(methodName + "-MATCH", srcStr, cmp); return false; } return count == 1;
-
equalsXOR
public static boolean equalsXOR(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrequals exactly one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrequals exactly one of the'compareStr'instances (andFALSEotherwise).
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
return XOR("equalsXOR", srcStr, compareStr, cmp -> srcStr.equals(cmp));
-
equalsNAND
public static boolean equalsNAND(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrdoes not equal any of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrdoes not equal any of the'compareStr'instances (andFALSEotherwise). - See Also:
NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
return NAND("equalsNAND", srcStr, compareStr, cmp -> srcStr.equals(cmp));
-
equalsXOR_CI
public static boolean equalsXOR_CI(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrequals exactly one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrequals exactly one of the'compareStr'instances (andFALSEotherwise).
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
return XOR("equalsXOR_CI", srcStr, compareStr, cmp -> srcStr.equalsIgnoreCase(cmp));
-
equalsNAND_CI
public static boolean equalsNAND_CI(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrdoes not equal any of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrdoes not equal any of the'compareStr'instances (andFALSEotherwise). - See Also:
NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
return NAND("equalsNAND_CI", srcStr, compareStr, cmp -> srcStr.equalsIgnoreCase(cmp));
-
containsOR
public static boolean containsOR(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrcontains at least one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrcontains at least one of the'compareStr'instances (andFALSEotherwise). - Code:
- Exact Method Body:
return CmprCN.CONTAINS(false, OR, srcStr, compareStr);
-
containsAND
public static boolean containsAND(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrcontains every one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrcontains every one of the'compareStr'instances (andFALSEotherwise). - Code:
- Exact Method Body:
return CmprCN.CONTAINS(false, AND, srcStr, compareStr);
-
containsXOR
public static boolean containsXOR(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrcontains exactly one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrcontains exactly one of the'compareStr'instances (andFALSEotherwise).
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - Code:
- Exact Method Body:
return CmprCN.CONTAINS(false, XOR, srcStr, compareStr);
-
containsNAND
public static boolean containsNAND(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrdoes not contain any of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrdoes not contain any of the'compareStr'instances (andFALSEotherwise). - Code:
- Exact Method Body:
return CmprCN.CONTAINS(false, NAND, srcStr, compareStr);
-
containsOR_CI
public static boolean containsOR_CI(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrcontains at least one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrcontains at least one of the'compareStr'instances (andFALSEotherwise). - Code:
- Exact Method Body:
return CmprCN.CONTAINS(true, OR, srcStr, compareStr);
-
containsAND_CI
public static boolean containsAND_CI(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrcontains every one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrcontains every one of the'compareStr'instances (andFALSEotherwise). - Code:
- Exact Method Body:
return CmprCN.CONTAINS(true, AND, srcStr, compareStr);
-
containsXOR_CI
public static boolean containsXOR_CI(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrcontains exactly one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrcontains exactly one of the'compareStr'instances (andFALSEotherwise).
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - Code:
- Exact Method Body:
return CmprCN.CONTAINS(true, XOR, srcStr, compareStr);
-
containsNAND_CI
public static boolean containsNAND_CI(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrdoes not contain any of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrdoes not contain any of the'compareStr'instances (andFALSEotherwise). - Code:
- Exact Method Body:
return CmprCN.CONTAINS(true, NAND, srcStr, compareStr);
-
endsWithXOR
public static boolean endsWithXOR(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrends with exactly one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrends with exactly one of the'compareStr'instances (andFALSEotherwise).
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
return XOR("endsWithXOR", srcStr, compareStr, cmp -> srcStr.endsWith(cmp));
-
endsWithNAND
public static boolean endsWithNAND(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrdoes not end with any of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrdoes not end with any of the'compareStr'instances (andFALSEotherwise). - See Also:
NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
return NAND("endsWithNAND", srcStr, compareStr, cmp -> srcStr.endsWith(cmp));
-
startsWithXOR
public static boolean startsWithXOR(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrstarts with exactly one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrstarts with exactly one of the'compareStr'instances (andFALSEotherwise).
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
return XOR("startsWithXOR", srcStr, compareStr, cmp -> srcStr.startsWith(cmp));
-
startsWithNAND
public static boolean startsWithNAND(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrdoes not start with any of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrdoes not start with any of the'compareStr'instances (andFALSEotherwise). - See Also:
NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
return NAND("startsWithNAND", srcStr, compareStr, cmp -> srcStr.startsWith(cmp));
-
endsWithXOR_CI
public static boolean endsWithXOR_CI(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrends with exactly one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrends with exactly one of the'compareStr'instances (andFALSEotherwise).
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
endsWithIgnoreCase(String, String),XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
return XOR("endsWithXOR_CI", srcStr, compareStr, cmp -> endsWithIgnoreCase(srcStr, cmp));
-
endsWithNAND_CI
public static boolean endsWithNAND_CI(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrdoes not end with any of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrdoes not end with any of the'compareStr'instances (andFALSEotherwise). - See Also:
endsWithIgnoreCase(String, String),NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
return NAND("endsWithNAND_CI", srcStr, compareStr, cmp -> endsWithIgnoreCase(srcStr, cmp));
-
startsWithXOR_CI
public static boolean startsWithXOR_CI(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrstarts with exactly one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrstarts with exactly one of the'compareStr'instances (andFALSEotherwise).
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
startsWithIgnoreCase(String, String),XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
return XOR( "startsWithXOR_CI", srcStr, compareStr, cmp -> startsWithIgnoreCase(srcStr, cmp) );
-
startsWithNAND_CI
public static boolean startsWithNAND_CI(java.lang.String srcStr, java.lang.String... compareStr)
Checks to ensure thatsrcStrdoes not start with any of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only ifsrcStrdoes not start with any of the'compareStr'instances (andFALSEotherwise). - See Also:
startsWithIgnoreCase(String, String),NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
return NAND( "startsWithNAND_CI", srcStr, compareStr, cmp -> startsWithIgnoreCase(srcStr, cmp) );
-
startsWithIgnoreCase
public static boolean startsWithIgnoreCase(java.lang.String srcStr, java.lang.String compareStr)
This performs the exact same comparison as Java'sString.startsWith(String)method. Java provides an'equalsIgnoreCase()'method, but not an'startsWithIgnoreCase()'. This method does just that.- Parameters:
srcStr- ThisStringis checked to see if it starts with thecompareStr.compareStr- ThisStringis checked against thesrcStr- specifically, ifsrcStrends withcompareStr- Returns:
TRUEifsrcStrstarts withcompareStr(ignoring-case), andFALSEotherwise.- Code:
- Exact Method Body:
return srcStr.regionMatches(true, 0, compareStr, 0, compareStr.length());
-
endsWithIgnoreCase
public static boolean endsWithIgnoreCase(java.lang.String srcStr, java.lang.String compareStr)
This performs the exact same comparison as Java'sString.endsWith(String)method. Java provides an'equalsIgnoreCase()'method, but not an'endsWithIgnoreCase()'. This method does just that.- Parameters:
srcStr- ThisStringis checked to see if it ends with thecompareStr.compareStr- ThisStringis checked against thesrcStr- specifically, ifsrcStrends withcompareStr- Returns:
TRUEifsrcStrends withcompareStr(ignoring-case), andFALSEotherwise.- Code:
- Exact Method Body:
final int compareStrLen = compareStr.length(); final int srcStrLen = srcStr.length(); return srcStr.regionMatches(true, srcStrLen - compareStrLen, compareStr, 0, compareStrLen);
-
containsIgnoreCase
public static boolean containsIgnoreCase(java.lang.String srcStr, java.lang.String compareStr)
This performs the exact same comparison as Java'sString.contains(String)method. Java provides an'equalsIgnoreCase()'method, but not a'containsIgnoreCase()'. This method does just that.- Parameters:
srcStr- ThisStringis checked to see if it contains thecompareStrcompareStr- ThisStringis checked against thesrcStr- specifically, ifcompareStris contained bysrcStr- Returns:
TRUEifcompareStris a substring ofsrcStr(ignoring-case), andFALSEotherwise.- Code:
- Exact Method Body:
return CmprCN.containsIgnoreCase(srcStr, new LV(srcStr, 0, srcStr.length()), compareStr);
-
equalsXOR
public static boolean equalsXOR(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - equals exactly one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') equals exactly one of the'compareStr'values.
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return XOR("equalsXOR", srcStr, compareStr, cmp -> CmprEQ.eq(srcStr, l, cmp));
-
equalsNAND
public static boolean equalsNAND(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - does not equal any of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') does not equal any of the'compareStr'values. - See Also:
NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return NAND("equalsNAND", srcStr, compareStr, cmp -> CmprEQ.eq(srcStr, l, cmp));
-
equalsXOR_CI
public static boolean equalsXOR_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - equals exactly one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') equals exactly one of the'compareStr'values.
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return XOR("equalsXOR_CI", srcStr, compareStr, cmp -> CmprEQ.eq_CI(srcStr, l, cmp));
-
equalsNAND_CI
public static boolean equalsNAND_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - does not equal any of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') does not equal any of the'compareStr'values. - See Also:
NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return NAND("equalsNAND_CI", srcStr, compareStr, cmp -> CmprEQ.eq_CI(srcStr, l, cmp));
-
containsOR
public static boolean containsOR(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - contains at least one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') contains at least one of the'compareStr'values. - Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return CmprCN.CONTAINS(false, OR, l, srcStr, compareStr);
-
containsAND
public static boolean containsAND(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - contains every one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') contains every one of the'compareStr'values. - Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return CmprCN.CONTAINS(false, AND, l, srcStr, compareStr);
-
containsXOR
public static boolean containsXOR(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - contains exactly one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') contains exactly one of the'compareStr'values.
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return CmprCN.CONTAINS(false, XOR, l, srcStr, compareStr);
-
containsNAND
public static boolean containsNAND(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - does not contain any of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') does not contain any of the'compareStr'values. - Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return CmprCN.CONTAINS(false, NAND, l, srcStr, compareStr);
-
containsOR_CI
public static boolean containsOR_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - contains at least one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') contains at least one of the'compareStr'values. - Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return CmprCN.CONTAINS(true, OR, l, srcStr, compareStr);
-
containsAND_CI
public static boolean containsAND_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - contains every one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') contains every one of the'compareStr'values. - Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return CmprCN.CONTAINS(true, AND, l, srcStr, compareStr);
-
containsXOR_CI
public static boolean containsXOR_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - contains exactly one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') contains exactly one of the'compareStr'values.
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return CmprCN.CONTAINS(true, XOR, l, srcStr, compareStr);
-
containsNAND_CI
public static boolean containsNAND_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - does not contain any of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') does not contain any of the'compareStr'values. - Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return CmprCN.CONTAINS(true, NAND, l, srcStr, compareStr);
-
endsWithXOR
public static boolean endsWithXOR(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - ends with exactly one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') ends with exactly one of the'compareStr'values.
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return XOR("endsWithXOR", srcStr, compareStr, cmp -> CmprEW.ew(srcStr, l, cmp));
-
endsWithNAND
public static boolean endsWithNAND(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - does not end with any of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') does not end with any of the'compareStr'values. - See Also:
NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return NAND("endsWithNAND", srcStr, compareStr, cmp -> CmprEW.ew(srcStr, l, cmp));
-
startsWithXOR
public static boolean startsWithXOR(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - starts with exactly one of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') starts with exactly one of the'compareStr'values.
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return XOR("startsWithXOR", srcStr, compareStr, cmp -> CmprSW.sw(srcStr, l, cmp));
-
startsWithNAND
public static boolean startsWithNAND(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - does not start with any of theString'sinside the'compareStr'array.The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') does not start with any of the'compareStr'values. - See Also:
NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return NAND("startsWithNAND", srcStr, compareStr, cmp -> CmprSW.sw(srcStr, l, cmp));
-
endsWithXOR_CI
public static boolean endsWithXOR_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - ends with exactly one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') ends with exactly one of the'compareStr'values.
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return XOR("endsWithXOR_CI", srcStr, compareStr, cmp -> CmprEW.ew_CI(srcStr, l, cmp));
-
endsWithNAND_CI
public static boolean endsWithNAND_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - does not end with any of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') does not end with any of the'compareStr'values. - See Also:
NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return NAND("endsWithNAND_CI", srcStr, compareStr, cmp -> CmprEW.ew_CI(srcStr, l, cmp));
-
startsWithXOR_CI
public static boolean startsWithXOR_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - starts with exactly one of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') starts with exactly one of the'compareStr'values.
An internal counter is maintained, and it must equal precisely one prior to exit in order for TRUE to be returned. In the case that multiple copies of an identicalStringhave been passed into parameterString[] compareStr, the returned-answer is best considered non-deterministic.. In practice, a second copy of an identical-String(or identical-ignoring case) will force the XOR comparison to returnFALSENote: No exception checks are performed oncompareStrfor duplicate elements in that array. This check is avoied essentially due to the performance over-head of checking for it. - See Also:
XOR(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return XOR("startsWithXOR_CI", srcStr, compareStr, cmp -> CmprSW.sw_CI(srcStr, l, cmp));
-
startsWithNAND_CI
public static boolean startsWithNAND_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String... compareStr)
Checks to ensure the substring ofsrcStr- demarcated by the parameters'sPos'(inclusive) and'ePos'(exclusive) - does not start with any of theString'sinside the'compareStr'array.The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheString'sused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') does not start with any of the'compareStr'values. - See Also:
NAND(String, String, String[], Predicate)- Code:
- Exact Method Body:
final LV l = new LV(srcStr, sPos, ePos); return NAND("startsWithNAND_CI", srcStr, compareStr, cmp -> CmprSW.sw_CI(srcStr, l, cmp));
-
equals
public static boolean equals(java.lang.String srcStr, int sPos, int ePos, java.lang.String compareStr)
Checks whether or not a substring of'srcStr'equals'compareStr'. The substring that is checked is demarcated by'sPos'(inclusive), and'ePos'(exclusive).The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheStringused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') equals'compareStr' - Code:
- Exact Method Body:
return CmprEQ.eq(srcStr, new LV(srcStr, sPos, ePos), compareStr);
-
equalsIgnoreCase
public static boolean equalsIgnoreCase(java.lang.String srcStr, int sPos, int ePos, java.lang.String compareStr)
Checks whether or not a substring of'srcStr'equals'compareStr'. The substring that is checked is demarcated by'sPos'(inclusive), and'ePos'(exclusive).The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheStringused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') equals'compareStr' - Code:
- Exact Method Body:
return CmprEQ.eq_CI(srcStr, new LV(srcStr, sPos, ePos), compareStr);
-
startsWith
public static boolean startsWith(java.lang.String srcStr, int sPos, int ePos, java.lang.String compareStr)
Checks whether or not a substring of'srcStr'starts with'compareStr'. The substring that is checked is demarcated by'sPos'(inclusive), and'ePos'(exclusive).The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheStringused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') starts with'compareStr' - Code:
- Exact Method Body:
return CmprSW.sw(srcStr, new LV(srcStr, sPos, ePos), compareStr);
-
startsWithIgnoreCase
public static boolean startsWithIgnoreCase(java.lang.String srcStr, int sPos, int ePos, java.lang.String compareStr)
Checks whether or not a substring of'srcStr'starts with'compareStr'. The substring that is checked is demarcated by'sPos'(inclusive), and'ePos'(exclusive).The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheStringused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') starts with'compareStr' - Code:
- Exact Method Body:
return CmprSW.sw_CI(srcStr, new LV(srcStr, sPos, ePos), compareStr);
-
endsWith
public static boolean endsWith(java.lang.String srcStr, int sPos, int ePos, java.lang.String compareStr)
Checks whether or not a substring of'srcStr'ends with'compareStr'. The substring that is checked is demarcated by'sPos'(inclusive), and'ePos'(exclusive).The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheStringused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') ends with'compareStr' - Code:
- Exact Method Body:
return CmprEW.ew(srcStr, new LV(srcStr, sPos, ePos), compareStr);
-
endsWithIgnoreCase
public static boolean endsWithIgnoreCase(java.lang.String srcStr, int sPos, int ePos, java.lang.String compareStr)
Checks whether or not a substring of'srcStr'ends with'compareStr'. The substring that is checked is demarcated by'sPos'(inclusive), and'ePos'(exclusive).The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheStringused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') ends with'compareStr' - Code:
- Exact Method Body:
return CmprEW.ew_CI(srcStr, new LV(srcStr, sPos, ePos), compareStr);
-
contains
public static boolean contains(java.lang.String srcStr, int sPos, int ePos, java.lang.String compareStr)
Checks whether or not a substring of'srcStr'contains'compareStr'. The substring that is checked is demarcated by'sPos'(inclusive), and'ePos'(exclusive).The test performed here ** is ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheStringused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') contains'compareStr' - Code:
- Exact Method Body:
return CmprCN.contains(srcStr, new LV(srcStr, sPos, ePos), compareStr);
-
containsIgnoreCase
public static boolean containsIgnoreCase(java.lang.String srcStr, int sPos, int ePos, java.lang.String compareStr)
Checks whether or not a substring of'srcStr'contains'compareStr'. The substring that is checked is demarcated by'sPos'(inclusive), and'ePos'(exclusive).The test performed here ** is not ** case-sensitive.- Parameters:
srcStr- Any non-null instance of ajava.lang.StringcompareStr- TheStringused in the comparison against'srcStr'- Returns:
- This will return
TRUEif and only if the specified substring between'sPos'and'ePos'(extraced from'srcStr') contains'compareStr' - Code:
- Exact Method Body:
return CmprCN.containsIgnoreCase(srcStr, new LV(srcStr, sPos, ePos), compareStr);
-
-