From 006f996283ac17953bd3c3c78f7ba8d17741f9ae Mon Sep 17 00:00:00 2001 From: GunfighterJ Date: Mon, 29 Apr 2013 14:04:59 -0500 Subject: [PATCH] Remove ArrayListInput Formatting --- .../src/com/earth2me/essentials/Kit.java | 4 +-- .../commands/Commandbalancetop.java | 4 +-- .../essentials/textreader/ArrayListInput.java | 31 ------------------- .../textreader/SimpleTextInput.java | 15 +++++---- 4 files changed, 13 insertions(+), 41 deletions(-) delete mode 100644 Essentials/src/com/earth2me/essentials/textreader/ArrayListInput.java diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 9bb94555b..571787384 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -107,11 +107,11 @@ public class Kit { IText input = new SimpleTextInput(items); IText output = new KeywordReplacer(input, user, ess); - + boolean spew = false; final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments(); for (String kitItem : output.getLines()) - { + { if (kitItem.startsWith(ess.getSettings().getCurrencySymbol())) { Double value = Double.parseDouble(kitItem.substring(ess.getSettings().getCurrencySymbol().length()).trim()); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java index 8cbf41809..b15071805 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; -import com.earth2me.essentials.textreader.ArrayListInput; +import com.earth2me.essentials.textreader.SimpleTextInput; import com.earth2me.essentials.textreader.TextPager; import java.text.DateFormat; import java.util.*; @@ -21,7 +21,7 @@ public class Commandbalancetop extends EssentialsCommand } private static final int CACHETIME = 2 * 60 * 1000; public static final int MINUSERS = 50; - private static ArrayListInput cache = new ArrayListInput(); + private static SimpleTextInput cache = new SimpleTextInput(); private static long cacheage = 0; private static ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); diff --git a/Essentials/src/com/earth2me/essentials/textreader/ArrayListInput.java b/Essentials/src/com/earth2me/essentials/textreader/ArrayListInput.java deleted file mode 100644 index 0da83f3b4..000000000 --- a/Essentials/src/com/earth2me/essentials/textreader/ArrayListInput.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.earth2me.essentials.textreader; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - - -public class ArrayListInput implements IText -{ - private final transient List lines = new ArrayList(); - - @Override - public List getLines() - { - return lines; - } - - @Override - public List getChapters() - { - return Collections.emptyList(); - } - - @Override - public Map getBookmarks() - { - return Collections.emptyMap(); - } - -} diff --git a/Essentials/src/com/earth2me/essentials/textreader/SimpleTextInput.java b/Essentials/src/com/earth2me/essentials/textreader/SimpleTextInput.java index b11907faf..f15ce6df5 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/SimpleTextInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/SimpleTextInput.java @@ -6,17 +6,21 @@ import java.util.*; public class SimpleTextInput implements IText { private final transient List lines = new ArrayList(); - - public SimpleTextInput (final String input) + + public SimpleTextInput(final String input) { lines.addAll(Arrays.asList(input.split("\\n"))); } - - public SimpleTextInput (final List input) + + public SimpleTextInput(final List input) { lines.addAll(input); } - + + public SimpleTextInput() + { + } + @Override public List getLines() { @@ -34,5 +38,4 @@ public class SimpleTextInput implements IText { return Collections.emptyMap(); } - }