palio.modules.cache
Class FastCache

java.lang.Object
  extended by palio.modules.cache.FastCache
All Implemented Interfaces:
Cache

public class FastCache
extends java.lang.Object
implements Cache

Implementacja bufora za pomocą klasy ConcurrentHashMap, która jest thread safe, ale nie zapewnia synchronizacji na poziomie metod.

Author:
Mateusz Gembarzewski
See Also:
ConcurrentHashMap}

Constructor Summary
FastCache()
           
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 java.lang.Object get(java.lang.Object key)
          Zwraca wartość przechowywaną pod danym kluczem.
 java.util.Set keys()
           
 void put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map m)
           
 void remove(java.lang.Object key)
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastCache

public FastCache()
Method Detail

get

public java.lang.Object get(java.lang.Object key)
Description copied from interface: Cache
Zwraca wartość przechowywaną pod danym kluczem.
Każdy bufor implementujący ten interfejs dla klucza null powinien zwracać wartość null.

Specified by:
get in interface Cache
Parameters:
key - klucz pod którym trzymany jest obiekt
Returns:
obiekt trzymany pod danym kluczem

put

public void put(java.lang.Object key,
                java.lang.Object value)
Specified by:
put in interface Cache

putAll

public void putAll(java.util.Map m)
Specified by:
putAll in interface Cache

remove

public void remove(java.lang.Object key)
Specified by:
remove in interface Cache

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface Cache

clear

public void clear()
Specified by:
clear in interface Cache

size

public int size()
Specified by:
size in interface Cache

keys

public java.util.Set keys()
Specified by:
keys in interface Cache