public abstract class FileAccessorCache<K,T> extends java.lang.Object implements EqualityPolicy<K>
Modifier and Type | Class and Description |
---|---|
static class |
FileAccessorCache.Handle<T> |
CANONICAL, IDENTITY
Constructor and Description |
---|
FileAccessorCache(int protectedQueueSize,
int probationalQueueSize) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
protected abstract T |
createAccessor(K key) |
protected abstract void |
disposeAccessor(T fileAccessor) |
FileAccessorCache.Handle<T> |
get(K key) |
int |
getHashCode(K value) |
FileAccessorCache.Handle<T> |
getIfCached(K key) |
boolean |
isEqual(K val1,
K val2) |
boolean |
remove(K key) |
public FileAccessorCache(int protectedQueueSize, int probationalQueueSize)
protected abstract T createAccessor(K key) throws java.io.IOException
java.io.IOException
protected abstract void disposeAccessor(T fileAccessor) throws java.io.IOException
java.io.IOException
public final FileAccessorCache.Handle<T> get(K key)
public FileAccessorCache.Handle<T> getIfCached(K key)
public boolean remove(K key)
public void clear()
public int getHashCode(K value)
getHashCode
in interface EqualityPolicy<K>
public boolean isEqual(K val1, K val2)
isEqual
in interface EqualityPolicy<K>