com.googlecode.jpattern.gwt.client.cache
Interface ICache

All Known Implementing Classes:
NullCache, PermanentCache, TimedCache

public interface ICache

Author:
Francesco Cina 26/lug/2011

Method Summary
 int cacheSize()
          return the total number of objects hold by the cache
 Object get(String key)
          Return the object associated to the key if exists, null otherwise
<T> T
get(String key, Class<T> clazz)
          Return the object associated to the key if exists, null otherwise
 int getHits()
          return the total number of times an object has not be found in the cache
 int getMissing()
          return the total number of times an object has not be found in the cache
 int getTotalcalls()
          return the total number of request to get an object from the cache
 void put(String key, Object value)
          Put a new object in the cache
 void remove(String key)
          Remove an object from the cache
 

Method Detail

put

void put(String key,
         Object value)
Put a new object in the cache

Parameters:
key -
value -

remove

void remove(String key)
Remove an object from the cache

Parameters:
key -

get

Object get(String key)
Return the object associated to the key if exists, null otherwise

Parameters:
key -
Returns:

get

<T> T get(String key,
          Class<T> clazz)
Return the object associated to the key if exists, null otherwise

Parameters:
key -
Returns:

cacheSize

int cacheSize()
return the total number of objects hold by the cache

Returns:

getMissing

int getMissing()
return the total number of times an object has not be found in the cache

Returns:

getHits

int getHits()
return the total number of times an object has not be found in the cache

Returns:

getTotalcalls

int getTotalcalls()
return the total number of request to get an object from the cache

Returns:


Copyright © 2011. All Rights Reserved.