Package org.jxmpp.util.cache
Interface Cache<K,V>
- Type Parameters:
K
- the type of the keys of this cache.V
- the type of the values this cache caches.
- All Known Implementing Classes:
ExpirationCache
,LruCache
public interface Cache<K,V>
This is jXMPP's cache interface.
-
Method Summary
Modifier and TypeMethodDescriptionint
Return the maximum cache Size.Returns the value of the specified key, ornull
.Put a value in the cache.void
setMaxCacheSize
(int size) Set the maximum cache size.
-
Method Details
-
put
Put a value in the cache.- Parameters:
key
- the key of the value.value
- the value.- Returns:
- the previous value or
null
.
-
lookup
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
Set the maximum cache size.- Parameters:
size
- the new maximum cache size.
-