public final class DoubleCache extends CacheBase
| Modifier and Type | Field and Description |
|---|---|
double |
answer |
int |
hash_value |
| Constructor and Description |
|---|
DoubleCache(String name,
int size)
the arguments are:
(size of elements, number of members.
|
| Modifier and Type | Method and Description |
|---|---|
double |
computeHitRate()
the hit rate, 0-100%
|
double |
computeLoadFactor()
the load factor, 0-100%
|
void |
free_or_grow()
try to grow the cache.
|
void |
free_or_grow(NodeTable nt)
either _partially_ wipe the cache or try to grow it.
|
long |
getAccessCount()
number of times the cache was accessed
|
int |
getCacheSize()
size of the cache
|
long |
getMemoryUsage() |
int |
getNumberOfClears()
number of times cache was cleared
|
int |
getNumberOfGrows()
number of times cache was growed
|
int |
getNumberOfPartialClears()
number of times cache was partially
|
int |
getSize()
the _real_ size of the cache.
|
void |
insert(int hash,
int key1,
double value)
this is the _correct_ way to insert something into the cache.
|
static void |
internal_test()
testbench.
|
void |
invalidate_cache()
just wipe the cache
|
void |
invalidate_cache(NodeTable nt)
removes the elements that are garbage collected.
|
boolean |
lookup(int a)
lookup the element associated with (a)
returns true if element found (stored in SimpleCache.answer)
returns false if element not found.
|
void |
showStats() |
public DoubleCache(String name, int size)
public int getSize()
public long getMemoryUsage()
public void invalidate_cache()
public void free_or_grow()
public void free_or_grow(NodeTable nt)
free_or_grow()public void invalidate_cache(NodeTable nt)
public void insert(int hash,
int key1,
double value)
public final boolean lookup(int a)
public double computeLoadFactor()
CacheBasecomputeLoadFactor in class CacheBasepublic double computeHitRate()
CacheBasecomputeHitRate in class CacheBasepublic long getAccessCount()
CacheBasegetAccessCount in class CacheBasepublic int getCacheSize()
CacheBasegetCacheSize in class CacheBasepublic int getNumberOfClears()
CacheBasegetNumberOfClears in class CacheBasepublic int getNumberOfPartialClears()
CacheBasegetNumberOfPartialClears in class CacheBasepublic int getNumberOfGrows()
CacheBasegetNumberOfGrows in class CacheBasepublic void showStats()
public static void internal_test()
This file is a part of the JDD package, a native Java Binary Decision Diagram Library.