diff options
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/handler/PlayerCache.java')
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/handler/PlayerCache.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/handler/PlayerCache.java b/src/main/java/de/cowtipper/cowlection/handler/PlayerCache.java index 6eb7904..caae8d5 100644 --- a/src/main/java/de/cowtipper/cowlection/handler/PlayerCache.java +++ b/src/main/java/de/cowtipper/cowlection/handler/PlayerCache.java @@ -8,7 +8,7 @@ import java.util.TreeSet; @SuppressWarnings("UnstableApiUsage") public class PlayerCache { private final EvictingQueue<String> nameCache = EvictingQueue.create(50); - private final EvictingQueue<String> bestFriendCache = EvictingQueue.create(100); + private final EvictingQueue<String> friendCache = EvictingQueue.create(100); public PlayerCache() { } @@ -19,25 +19,25 @@ public class PlayerCache { nameCache.add(name); } - public void addBestFriend(String name) { + public void addFriend(String name) { // remove old entry (if exists) to 'push' name to the end of the queue - bestFriendCache.remove(name); - bestFriendCache.add(name); + friendCache.remove(name); + friendCache.add(name); } - public void removeBestFriend(String name) { - bestFriendCache.remove(name); + public void removeFriend(String name) { + friendCache.remove(name); } public SortedSet<String> getAllNamesSorted() { SortedSet<String> nameList = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); - nameList.addAll(bestFriendCache); + nameList.addAll(friendCache); nameList.addAll(nameCache); return nameList; } public void clearAllCaches() { nameCache.clear(); - bestFriendCache.clear(); + friendCache.clear(); } } |