xtdb.util.LRU Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xtdb-core Show documentation
Show all versions of xtdb-core Show documentation
An open source document database with bitemporal graph queries
package xtdb.util;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
import java.util.function.BiPredicate;
public class LRU extends LinkedHashMap {
private static final long serialVersionUID = -4055957566679424062L;
private final BiPredicate, Entry> removeEldestEntryFn;
public LRU(int size, BiPredicate, Entry> removeEldestEntryFn) {
super(size, 0.75f, true);
this.removeEldestEntryFn = removeEldestEntryFn;
}
public boolean removeEldestEntry(Entry entry) {
return this.removeEldestEntryFn.test(this, entry);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy