public abstract class AbstractFormatCache extends java.lang.Object implements FormatCache
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.Integer,TableFormat> |
cache |
protected java.util.concurrent.locks.ReentrantReadWriteLock |
cacheLock |
protected java.util.Map<TableFormat,java.lang.Integer> |
reverse |
| Constructor and Description |
|---|
AbstractFormatCache(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.lang.Integer |
add(TableFormat tableFormat) |
java.lang.Integer |
addIfNotExists(TableFormat format) |
protected TableFormat |
addImpl(TableFormat format,
int id) |
void |
clear() |
TableFormat |
get(int id) |
TableFormat |
getCachedVersion(TableFormat format) |
java.lang.String |
getName() |
int |
getSize() |
protected java.lang.Integer |
obtainId(TableFormat format) |
void |
put(int id,
TableFormat format) |
protected final java.util.Map<java.lang.Integer,TableFormat> cache
protected final java.util.Map<TableFormat,java.lang.Integer> reverse
protected final java.util.concurrent.locks.ReentrantReadWriteLock cacheLock
public java.lang.String getName()
getName in interface FormatCachepublic int getSize()
public TableFormat get(int id)
get in interface FormatCacheprotected TableFormat addImpl(TableFormat format, int id)
public java.lang.Integer addIfNotExists(TableFormat format)
addIfNotExists in interface FormatCacheprotected abstract java.lang.Integer add(TableFormat tableFormat)
protected java.lang.Integer obtainId(TableFormat format)
public TableFormat getCachedVersion(TableFormat format)
getCachedVersion in interface FormatCachepublic void clear()
clear in interface FormatCachepublic void put(int id,
TableFormat format)
put in interface FormatCache