Code reformat
This commit is contained in:
parent
99633e0cae
commit
8d4a16efe6
@ -107,7 +107,7 @@ public class ToJsclTextProcessor implements TextProcessor<PreparedExpression, St
|
||||
|
||||
final StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
startsWithFinder.setI(i);
|
||||
startsWithFinder.setOffset(i);
|
||||
|
||||
int offset = 0;
|
||||
String functionName = Iterables.find(MathType.function.getTokens(engine), startsWithFinder, null);
|
||||
|
@ -29,14 +29,13 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class StartsWithFinder implements Predicate<String> {
|
||||
|
||||
private int i;
|
||||
|
||||
@Nonnull
|
||||
private final String targetString;
|
||||
private final String string;
|
||||
private int offset;
|
||||
|
||||
private StartsWithFinder(@Nonnull String targetString, int i) {
|
||||
this.targetString = targetString;
|
||||
this.i = i;
|
||||
private StartsWithFinder(@Nonnull String string, int offset) {
|
||||
this.string = string;
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@ -50,11 +49,11 @@ public class StartsWithFinder implements Predicate<String> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(@Nullable String s) {
|
||||
return s != null && targetString.startsWith(s, i);
|
||||
public boolean apply(@Nullable String prefix) {
|
||||
return prefix != null && string.startsWith(prefix, offset);
|
||||
}
|
||||
|
||||
public void setI(int i) {
|
||||
this.i = i;
|
||||
public void setOffset(int offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user