apply new code formatter and save action
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -4,32 +4,32 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class LRUCache<K, V> {
|
||||
private final LinkedHashMap<K, V> cache;
|
||||
private final LinkedHashMap<K, V> cache;
|
||||
|
||||
public LRUCache(final int maxEntries) {
|
||||
this.cache = new LinkedHashMap<>(16, 0.75f, true) {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public LRUCache(final int maxEntries) {
|
||||
this.cache = new LinkedHashMap<>(16, 0.75f, true) {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected boolean removeEldestEntry(final Map.Entry<K, V> eldest) {
|
||||
return size() > maxEntries;
|
||||
}
|
||||
};
|
||||
}
|
||||
protected boolean removeEldestEntry(final Map.Entry<K, V> eldest) {
|
||||
return size() > maxEntries;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public V put(final K key, final V value) {
|
||||
return cache.put(key, value);
|
||||
}
|
||||
public V put(final K key, final V value) {
|
||||
return cache.put(key, value);
|
||||
}
|
||||
|
||||
public V get(final K key) {
|
||||
return cache.get(key);
|
||||
}
|
||||
public V get(final K key) {
|
||||
return cache.get(key);
|
||||
}
|
||||
|
||||
public V remove(final K key) {
|
||||
return cache.remove(key);
|
||||
}
|
||||
public V remove(final K key) {
|
||||
return cache.remove(key);
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return cache.size();
|
||||
}
|
||||
public int size() {
|
||||
return cache.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ import java.util.concurrent.ExecutionException;
|
||||
|
||||
public class RuntimeExcecutionException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = -3626851728980513527L;
|
||||
private static final long serialVersionUID = -3626851728980513527L;
|
||||
|
||||
public RuntimeExcecutionException(final ExecutionException e) {
|
||||
super(e);
|
||||
}
|
||||
public RuntimeExcecutionException(final ExecutionException e) {
|
||||
super(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user