No effective change - format only

This commit is contained in:
Robin Bygrave committed 2015-08-01 08:54:49 +12:00
1 parent f50b18556e
commit 4f2d669897
34 files changed
+1283 -1291

No files matched your search

@@ -2,62 +2,62 @@ package com.avaje.ebeaninternal.server.query;
public class SplitName {
public static String add(String prefix, String name){
if (prefix != null){
return prefix+"."+name;
} else {
return name;
}
}
/**
* Return the number of occurrences of char in name.
*/
public static int count(char c, String name){
int count = 0;
for (int i = 0; i < name.length(); i++) {
if (c == name.charAt(i)){
count++;
}
}
return count;
}
/**
* Return the parent part of the path.
*/
public static String parent(String name) {
if (name == null){
return null;
} else {
String[] s = split(name, true);
return s[0];
}
public static String add(String prefix, String name) {
if (prefix != null) {
return prefix + "." + name;
} else {
return name;
}
}
public static String[] split(String name){
return split(name, true);
}
public static String[] splitBegin(String name){
return split(name, false);
}
private static String[] split(String name, boolean last){
int pos = last ? name.lastIndexOf('.') : name.indexOf('.');
if (pos == -1){
if (last){
return new String[]{null, name};
} else {
return new String[]{name, null};
}
} else {
String s0 = name.substring(0, pos);
String s1 = name.substring(pos+1);
return new String[]{s0,s1};
}
}
/**
* Return the number of occurrences of char in name.
*/
public static int count(char c, String name) {
int count = 0;
for (int i = 0; i < name.length(); i++) {
if (c == name.charAt(i)) {
count++;
}
}
return count;
}
/**
* Return the parent part of the path.
*/
public static String parent(String name) {
if (name == null) {
return null;
} else {
String[] s = split(name, true);
return s[0];
}
}
public static String[] split(String name) {
return split(name, true);
}
public static String[] splitBegin(String name) {
return split(name, false);
}
private static String[] split(String name, boolean last) {
int pos = last ? name.lastIndexOf('.') : name.indexOf('.');
if (pos == -1) {
if (last) {
return new String[]{null, name};
} else {
return new String[]{name, null};
}
} else {
String s0 = name.substring(0, pos);
String s1 = name.substring(pos + 1);
return new String[]{s0, s1};
}
}
}