|
DODS 7.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap
org.enhydra.dods.cache.complete.DODSHashMapCache
public class DODSHashMapCache
DODSHashMapCache class implements HashMap cache (for storing data objects (or DataStruct objects), or simple queries, or complex queries), and provides query statistics about the cache (query number, cache hits number, their get/set/increment methods, percents of used cache, cache hits,...).
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary | |
---|---|
protected int |
cacheAccessNum
Total number of times the cache was accessed. |
protected int |
cacheHitsNum
Number of queries performed on the cache successfully. |
Method Summary | |
---|---|
java.lang.Object |
add(java.lang.Object key,
java.lang.Object value)
Adds a pair (key, value) to the cache. |
void |
clearStatistics()
Clears statistics. |
int |
getCacheAccessNum()
Returns total number of times the cache was accessed. |
int |
getCacheHitsNum()
Returns number of queries performed on the cache successfully. |
double |
getCacheHitsPercents()
Returns how much queries performed on the cache were successful. |
int |
getMaxEntries()
Returns maximal number of objects in DODSHashMapCache. |
double |
getUsedPercents()
Returns how much cache is currently used. |
void |
incrementCacheAccessNum(int num)
Increases total number of times the cache was accessed. |
void |
incrementCacheHitsNum(int num)
Increases number of queries performed on the cache successfully for one. |
boolean |
isNeedToSynchronize()
|
void |
setCacheAccessNum(int num)
Sets total number of times the cache was accessed. |
void |
setCacheHitsNum(int cacheHitsNum)
Sets number of queries performed on the cache successfully. |
void |
setMaxEntries(int max)
Sets maximal number of objects in DODSHashMapCache (if the number is negative). |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Field Detail |
---|
protected int cacheAccessNum
protected int cacheHitsNum
Method Detail |
---|
public java.lang.Object add(java.lang.Object key, java.lang.Object value)
add
in interface DODSCache
key
- Key asociated with the value.value
- Value that will be added to the cache.
public int getMaxEntries()
getMaxEntries
in interface DODSCache
public void setMaxEntries(int max)
setMaxEntries
in interface DODSCache
max
- New value of maximal number of objects in
DODSHashMapCache.public boolean isNeedToSynchronize()
isNeedToSynchronize
in interface DODSCache
public int getCacheAccessNum()
getCacheAccessNum
in interface org.enhydra.dods.statistics.CacheStatistics
public void setCacheAccessNum(int num)
setCacheAccessNum
in interface org.enhydra.dods.statistics.CacheStatistics
num
- Total number of times the cache was accessed.public void incrementCacheAccessNum(int num)
incrementCacheAccessNum
in interface org.enhydra.dods.statistics.CacheStatistics
public int getCacheHitsNum()
getCacheHitsNum
in interface org.enhydra.dods.statistics.CacheStatistics
public void setCacheHitsNum(int cacheHitsNum)
setCacheHitsNum
in interface org.enhydra.dods.statistics.CacheStatistics
cacheHitsNum
- Number of queries performed on the cache
successfully.public void incrementCacheHitsNum(int num)
incrementCacheHitsNum
in interface org.enhydra.dods.statistics.CacheStatistics
public double getUsedPercents()
getUsedPercents
in interface org.enhydra.dods.statistics.CacheStatistics
public double getCacheHitsPercents()
getCacheHitsPercents
in interface org.enhydra.dods.statistics.CacheStatistics
public void clearStatistics()
clearStatistics
in interface org.enhydra.dods.statistics.CacheStatistics
|
DODS 7.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |