summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java
diff options
context:
space:
mode:
authorbjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu>2017-03-24 10:53:59 -0400
committerbjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu>2017-03-24 10:53:59 -0400
commit33918524d7faab0146a0a92c13eaaef46cdbea8a (patch)
tree181667f19bea884cbd0e8d11520d88a29b82a155 /BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java
parent41c2a41eaf3c2dd158a2a51947180f402918229e (diff)
Update Pratt parser.
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.java15
1 files changed, 8 insertions, 7 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 b142948..51be875 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/funcutils/StringUtils.java
@@ -22,9 +22,10 @@ public class StringUtils {
* of the provided regex
*/
public static boolean containsOnly(String input, String regex) {
- if(input == null)
+ if (input == null)
throw new NullPointerException("Input must not be null");
- else if(regex == null) throw new NullPointerException("Regex must not be null");
+ else if (regex == null)
+ throw new NullPointerException("Regex must not be null");
/*
* This regular expression is fairly simple.
@@ -46,7 +47,7 @@ public class StringUtils {
* The number of levels to indent
*/
public static void indentNLevels(StringBuilder builder, int levels) {
- for(int i = 0; i < levels; i++) {
+ for (int i = 0; i < levels; i++) {
builder.append("\t");
}
}
@@ -80,7 +81,7 @@ public class StringUtils {
* @return
*/
public static String toEnglishList(Object[] objects, String join, String comma) {
- if(objects == null) {
+ if (objects == null) {
throw new NullPointerException("Sequence must not be null");
}
@@ -89,7 +90,7 @@ public class StringUtils {
String joiner = join;
String coma = comma;
- switch(objects.length) {
+ switch (objects.length) {
case 0:
/*
* Empty list.
@@ -113,7 +114,7 @@ public class StringUtils {
/*
* Three or more items.
*/
- for(int i = 0; i < objects.length - 1; i++) {
+ for (int i = 0; i < objects.length - 1; i++) {
sb.append(objects[i].toString());
sb.append(coma + " ");
}
@@ -157,7 +158,7 @@ public class StringUtils {
* @return
*/
public static String toEnglishList(Object[] objects, boolean and) {
- if(and) {
+ if (and) {
return toEnglishList(objects, "and");
} else {
return toEnglishList(objects, "or");