diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-22 14:48:04 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-22 14:48:04 -0400 |
| commit | 42f7d379a430aaf2fad169f0170de04072b08b10 (patch) | |
| tree | 5d46b43b2d9272f4e593820ee147b3ae3f0d82b0 /BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java | |
| parent | b65b705c391bb772bc41269bce5243c1cc88969d (diff) | |
Formatting changes
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java b/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java index 728968e..2f8aa09 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java @@ -11,6 +11,27 @@ import java.util.Deque; public class StringUtils { /** + * Checks if the given expression contains the specified operator in a + * situation that indicates its use as an infix operator. + * + * @param expression + * The expression to check + * @param operator + * The operator to see if it is contained + * @return Whether or not the given expression contains the specified + * operator as a infix operator + */ + public static boolean containsInfixOperator(String expression, + String operator) { + // Bit annoying to have to use a full class name, but what are you + // going to do? + return org.apache.commons.lang3.StringUtils + .countMatches(expression, operator) == 1 + && !expression.equalsIgnoreCase(operator) + && !expression.startsWith(operator); + } + + /** * Check if a string consists only of one or more matches of a regular * expression * @@ -40,27 +61,6 @@ public class StringUtils { } /** - * Checks if the given expression contains the specified operator in a - * situation that indicates its use as an infix operator. - * - * @param expression - * The expression to check - * @param operator - * The operator to see if it is contained - * @return Whether or not the given expression contains the specified - * operator as a infix operator - */ - public static boolean containsInfixOperator(String expression, - String operator) { - // Bit annoying to have to use a full class name, but what are you - // going to do? - return org.apache.commons.lang3.StringUtils - .countMatches(expression, operator) == 1 - && !expression.equalsIgnoreCase(operator) - && !expression.startsWith(operator); - } - - /** * Indent the string being built in a StringBuilder n levels * * @param builder |
