|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.util.CacheLRU
public class CacheLRU
A cache implementation based on the last recently used (LRU) algorithm.
Method Summary | |
---|---|
void |
clear()
Clear the cache. |
CacheObject |
find(int pos)
Get an element from the cache if it is available. |
CacheObject |
get(int pos)
Get an element in the cache if it is available. |
ObjectArray<CacheObject> |
getAllChanged()
Get all objects in the cache that have been changed. |
static Cache |
getCache(CacheWriter writer,
java.lang.String cacheType,
int cacheSize)
Create a cache of the given type and size. |
int |
getMaxSize()
Get the maximum size in words (4 bytes). |
int |
getSize()
Get the used size in words (4 bytes). |
java.lang.String |
getTypeName()
Get the name of the cache type in a human readable form. |
void |
put(CacheObject rec)
Add an element to the cache. |
void |
remove(int pos)
Remove an object from the cache. |
void |
setMaxSize(int maxKb)
Set the maximum memory to be used by this cache. |
CacheObject |
update(int pos,
CacheObject rec)
Update an element in the cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Cache getCache(CacheWriter writer, java.lang.String cacheType, int cacheSize) throws java.sql.SQLException
writer
- the cache writercacheType
- the cache typecacheSize
- the size
java.sql.SQLException
public void clear()
Cache
clear
in interface Cache
public void put(CacheObject rec) throws java.sql.SQLException
Cache
put
in interface Cache
rec
- the object
java.sql.SQLException
public CacheObject update(int pos, CacheObject rec) throws java.sql.SQLException
Cache
update
in interface Cache
pos
- the unique key of the elementrec
- the element
java.sql.SQLException
public void remove(int pos)
Cache
remove
in interface Cache
pos
- the unique key of the elementpublic CacheObject find(int pos)
Cache
find
in interface Cache
pos
- the unique key of the element
public CacheObject get(int pos)
Cache
get
in interface Cache
pos
- the unique key of the element
public ObjectArray<CacheObject> getAllChanged()
Cache
getAllChanged
in interface Cache
public void setMaxSize(int maxKb) throws java.sql.SQLException
Cache
setMaxSize
in interface Cache
maxKb
- in number of double words (4 bytes)
java.sql.SQLException
public java.lang.String getTypeName()
Cache
getTypeName
in interface Cache
public int getMaxSize()
Cache
getMaxSize
in interface Cache
public int getSize()
Cache
getSize
in interface Cache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |