iitb.con.caching
Interface Cache<K>

All Known Implementing Classes:
LRUCache, MRUCache

public interface Cache<K>

Caching for Queries


Method Summary
 void clear()
          Clears the cache
 long freeSpace()
          Returns the available free space
 CacheObject get(K key)
          Returns the cached object for the given key
 long getSize()
          Returns the size of cache in bytes
 boolean put(K key, CacheObject obj)
          Places the cache object in the cache using the key
 

Method Detail

clear

void clear()
Clears the cache


freeSpace

long freeSpace()
Returns the available free space

Returns:
cache free space

get

CacheObject get(K key)
Returns the cached object for the given key

Parameters:
key - key used to retrieve the object
Returns:
cached object if present, else returns NULL
See Also:
CacheObject

getSize

long getSize()
Returns the size of cache in bytes

Returns:
cache size as long

put

boolean put(K key,
            CacheObject obj)
Places the cache object in the cache using the key

Parameters:
key - key used to place the object
obj - cache object
Returns:
true on success
See Also:
CacheObject