tauZaman
v0.1

tauzaman.calendricsystem.granularitylattice.cache
Class Cache

java.lang.Object
  |
  +--tauzaman.calendricsystem.granularitylattice.cache.Cache

public class Cache
extends java.lang.Object


Constructor Summary
Cache(int cacheSize)
          Constructs a Cache object of a given size.
 
Method Summary
 java.lang.Object get(java.lang.Object key)
          Gets an element from the cache.
 java.lang.Object insert(java.lang.Object key, java.lang.Object value)
          Inserts an entry into the cache.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cache

public Cache(int cacheSize)
Constructs a Cache object of a given size.

Parameters:
cacheSize - the (maximal) size of the cache
Method Detail

insert

public java.lang.Object insert(java.lang.Object key,
                               java.lang.Object value)
Inserts an entry into the cache.

Parameters:
key - the value by with the element is indexed in the cache
value - the element to be cached
Returns:
the old value that was in the cache if the key was already present in the cache

get

public java.lang.Object get(java.lang.Object key)
Gets an element from the cache.

Parameters:
key - the value which indexes the element to be gotten
Returns:
the element

tauZaman
v0.1

Submit a bug or feature

tauZaman is an open-source, publicly avaliable project