org.apache.felix.eventadmin.impl.util
Interface CacheMap

All Known Implementing Classes:
LeastRecentlyUsedCacheMap

public interface CacheMap

This is the interface of a simple cache map.

Author:
Felix Project Team

Method Summary
 void add(java.lang.Object key, java.lang.Object value)
          Add a value for the key to this cache.
 void clear()
          Remove all entries of the cache.
 java.lang.Object get(java.lang.Object key)
          Return the value for the key in case there is one in the cache.
 java.lang.Object remove(java.lang.Object key)
          Remove a key and its value from the cache.
 int size()
          Returns the number of key-value pairs in this cache.
 

Method Detail

get

java.lang.Object get(java.lang.Object key)
Return the value for the key in case there is one in the cache.

Parameters:
key - The key to look-up
Returns:
The value for the given key in case there is one in the cache, null otherwise

add

void add(java.lang.Object key,
         java.lang.Object value)
Add a value for the key to this cache.

Parameters:
key - The key for the value
value - The value to add to the cache

remove

java.lang.Object remove(java.lang.Object key)
Remove a key and its value from the cache.

Parameters:
key - The key to remove
Returns:
The value of the key in case there is one in the cache, null otherwise

size

int size()
Returns the number of key-value pairs in this cache.

Returns:
The number of key-value pairs in this cache

clear

void clear()
Remove all entries of the cache.