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 Type
    Method
    Description
    int
    Return the maximum cache Size.
    lookup(K key)
    Returns the value of the specified key, or null.
    put(K key, V value)
    Put a value in the cache.
    void
    setMaxCacheSize(int size)
    Set the maximum cache size.
  • Method Details

    • 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, or null.
      Parameters:
      key - the key.
      Returns:
      the value found in the cache, or null.
    • 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.