From 2c15e43d878b3d14ecd88efbbd82fa92ee79c8b9 Mon Sep 17 00:00:00 2001 From: serso Date: Fri, 4 Mar 2016 22:41:27 +0100 Subject: [PATCH] Use old good for loop --- .../calculator/ToJsclTextProcessor.java | 12 +--- .../common/search/StartsWithFinder.java | 59 ------------------- 2 files changed, 3 insertions(+), 68 deletions(-) delete mode 100644 jscl/src/main/java/org/solovyev/common/search/StartsWithFinder.java diff --git a/app/src/main/java/org/solovyev/android/calculator/ToJsclTextProcessor.java b/app/src/main/java/org/solovyev/android/calculator/ToJsclTextProcessor.java index 9ea5744c..f11c23f7 100644 --- a/app/src/main/java/org/solovyev/android/calculator/ToJsclTextProcessor.java +++ b/app/src/main/java/org/solovyev/android/calculator/ToJsclTextProcessor.java @@ -22,13 +22,11 @@ package org.solovyev.android.calculator; -import com.google.common.collect.Iterables; import jscl.math.function.Function; import jscl.math.function.IConstant; import org.solovyev.android.calculator.math.MathType; import org.solovyev.android.calculator.text.TextProcessor; import org.solovyev.common.msg.MessageType; -import org.solovyev.common.search.StartsWithFinder; import javax.annotation.Nonnull; import javax.inject.Inject; @@ -103,18 +101,14 @@ public class ToJsclTextProcessor implements TextProcessor { - - @Nonnull - private final String string; - private int offset; - - private StartsWithFinder(@Nonnull String string, int offset) { - this.string = string; - this.offset = offset; - } - - @Nonnull - public static StartsWithFinder newFrom(@Nonnull String targetString, int i) { - return new StartsWithFinder(targetString, i); - } - - @Nonnull - public static StartsWithFinder newInstance(@Nonnull String targetString) { - return newFrom(targetString, 0); - } - - @Override - public boolean apply(@Nullable String prefix) { - return prefix != null && string.startsWith(prefix, offset); - } - - public void setOffset(int offset) { - this.offset = offset; - } -}