dk.vajhoej.isam
Class KeyInfoArrayCache

java.lang.Object
  extended by dk.vajhoej.isam.KeyInfoArrayCache

public class KeyInfoArrayCache
extends java.lang.Object

Class KeyInfoArrayCache caches KeyInfo array objects in a singleton cache.


Method Summary
static
<T> KeyInfo[]
analyze(java.lang.Class<T> t)
          Convenience method to get KeyInfo array from cache and analyze class if not in cache.
 KeyInfo[] get(java.lang.Class<?> clz)
          Get KeyInfo array from cache.
 double getHitRate()
          Get cache hit rate.
static KeyInfoArrayCache getInstance()
          Get singleton instance.
 void put(java.lang.Class<?> clz, KeyInfo[] kia)
          Put KeyInfo array into cache.
 void reset()
          Reset cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static KeyInfoArrayCache getInstance()
Get singleton instance.

Returns:
instance

get

public KeyInfo[] get(java.lang.Class<?> clz)
Get KeyInfo array from cache.

Parameters:
clz - class we want KeyInfo array for
Returns:
KeyInfo array

put

public void put(java.lang.Class<?> clz,
                KeyInfo[] kia)
Put KeyInfo array into cache.

Parameters:
clz - class we have KeyInfo array for
kia - KeyInfo array

getHitRate

public double getHitRate()
Get cache hit rate.

Returns:
hit rate

reset

public void reset()
Reset cache.


analyze

public static <T> KeyInfo[] analyze(java.lang.Class<T> t)
                         throws IsamException
Convenience method to get KeyInfo array from cache and analyze class if not in cache.

Parameters:
t - class
Returns:
KeyInfo array
Throws:
IsamException