Package org.jxmpp.util.cache
Interface Cache<K,V>
-
- All Known Implementing Classes:
ExpirationCache
,LruCache
public interface Cache<K,V>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getMaxCacheSize()
Return the maximum cache Size.V
lookup(K key)
Returns the value of the specified key, ornull
.V
put(K key, V value)
Put a value in the cache.void
setMaxCacheSize(int size)
Set the maximum cache size.
-
-
-
Method Detail
-
put
V put(K key, V value)
Put a value in the cache.- Parameters:
key
- the key of the value.value
- the value.- Returns:
- the previous value or
null
.
-
lookup
V lookup(K key)
Returns the value of the specified key, ornull
.- Parameters:
key
- the key.- Returns:
- the value found in the cache, or
null
.
-
getMaxCacheSize
int getMaxCacheSize()
Return the maximum cache Size.- Returns:
- the maximum cache size.
-
setMaxCacheSize
void setMaxCacheSize(int size)
Set the maximum cache size.- Parameters:
size
- the new maximum cache size.
-
-