Matches string pattern.
int length = sb.length();
// does the string start with 'end' ?
int index = -1;
int stopIndex = length - parameter.length - 3;
for (int i = 0; i < stopIndex && index == -1; i++) {
switch (sb.charAt(i)) {
case ' ":
case '\t":
continue;
case 'e":
case 'E":
switch (sb.charAt(i + 1)) {
case 'n":
case 'N":
switch (sb.charAt(i + 2)) {
case 'd":
case 'D":
index = i + 3;
break;
default:
return false;
}
break;
default:
return false;
}
break;
default:
return false;
}
}
if (index == -1) {
return false;
}
boolean foundColon = false;
stopIndex = length - parameter.length + 1;
while (index < stopIndex) {
switch (sb.charAt(index)) {
case ':":
if (foundColon) {
return false;
} else {
foundColon = true;
}
case ' ":
case '\t":
break;
default:
if (index != stopIndex - 1) {
return false;
}
char[] cs = new char[parameter.length];
sb.getChars(index, index + parameter.length, cs, 0);
for (int i = 0; i < cs.length; i++) {
char c = cs[i];
if (c != parameter[i] && c != parameter2[i]) {
return false;
}
}
return true;
}
index ++;
}
return false;