public final class RandomCache extends CacheBase
| Modifier and Type | Field and Description |
|---|---|
int |
answer |
int |
hash_value |
| Constructor and Description |
|---|
RandomCache(String name,
int size,
int members,
int bdds)
the arguments are:
(size of elements, number of members.
|
| Modifier and Type | Method and Description |
|---|---|
void |
check_cache(int[] t_var) |
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(int[] valid)
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
|
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,
int value)
this is the _correct_ way to insert something into the cache.
|
void |
insert(int hash,
int key1,
int key2,
int value)
this is the _correct_ way to insert something into the cache.
|
void |
insert(int hash,
int key1,
int key2,
int key3,
int value)
this is the _correct_ way to insert something into the cache.
|
void |
invalidate_cache()
just wipe the cache
|
void |
invalidate_cache(int[] valid)
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.
|
boolean |
lookup(int a,
int b)
lookup the element associated with (a,b)
returns true if element found (stored in SimpleCache.answer)
returns false if element not found.
|
boolean |
lookup(int a,
int b,
int c)
lookup the element associated with (a,b,c)
returns true if element found (stored in SimpleCache.answer)
returns false if element not found.
|
void |
showStats() |
public RandomCache(String name, int size, int members, int bdds)
public int getSize()
public void invalidate_cache()
public void free_or_grow()
public void free_or_grow(int[] valid)
free_or_grow()public void invalidate_cache(int[] valid)
public void insert(int hash,
int key1,
int value)
public void insert(int hash,
int key1,
int key2,
int value)
public void insert(int hash,
int key1,
int key2,
int key3,
int value)
public final boolean lookup(int a)
public final boolean lookup(int a,
int b)
public final boolean lookup(int a,
int b,
int c)
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 void check_cache(int[] t_var)
This file is a part of the JDD package, a native Java Binary Decision Diagram Library.