diff --git a/src/main/java/de/rayzs/pat/utils/ExpireList.java b/src/main/java/de/rayzs/pat/utils/ExpireList.java deleted file mode 100644 index 3ffb3e6e..00000000 --- a/src/main/java/de/rayzs/pat/utils/ExpireList.java +++ /dev/null @@ -1,41 +0,0 @@ -package de.rayzs.pat.utils; - - -import com.google.common.cache.*; -import java.util.concurrent.TimeUnit; - -public class ExpireList { - - private final Cache cache; - - public ExpireList(long expireTime, TimeUnit timeUnit) { - cache = CacheBuilder.newBuilder().concurrencyLevel(2).expireAfterWrite(expireTime, timeUnit).build(); - } - - public ExpireList(ExpireList expireList) { - cache = expireList.getCache(); - } - - public boolean add(T t) { - if(contains(t)) return false; - cache.put(t, (byte) 0); - return true; - } - - public void addIgnoreIfContains(T t) { - cache.put(t, (byte) 0); - } - - public int getSize() { - cache.cleanUp(); - return (int) cache.size(); - } - - public Cache getCache() { - return cache; - } - - public boolean contains(T t) { - return cache.getIfPresent(t) != null; - } -}