public class KObjectCache
extends java.lang.Object
Constructor and Description |
---|
KObjectCache(int maximumSize)
Constructs a KMemoryDataCache with the specified maximum size
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String key)
Checks if the table contains the data with the specified keys
|
long |
getCurrentSize()
Gets the memory cache current size
|
double |
getEfficiency()
This method returns the sucessfull retrieval data count over the number of retrieval attemps
It enables to get statistic of the retrieve method
|
long |
getMaximumSize()
Gets the memory cache maximum allowed size
|
void |
remove(java.lang.String key)
Removes the memory cache with the specified key
|
java.lang.Object |
retrieve(java.lang.String key)
Retrieves the data previously stored using the specified key.
|
void |
store(java.lang.String key,
java.lang.Object object)
Stores the specified object in memory cache using the specified key.
|
public KObjectCache(int maximumSize)
maximumSize
- the maximum number of objects the cache can containpublic void store(java.lang.String key, java.lang.Object object)
key
- the key of the KMemoryDataCache where to store the dataobject
- the object to be storedpublic java.lang.Object retrieve(java.lang.String key)
key
- unique identifier used to search for the corresponding datapublic boolean contains(java.lang.String key)
key
- the corresponding keypublic long getCurrentSize()
public long getMaximumSize()
public void remove(java.lang.String key)
key
- the key of the data to be removedpublic double getEfficiency()