com.openexchange.mail.cache
Class UniversalCache<K,V>

java.lang.Object
  extended by com.openexchange.mail.cache.UniversalCache<K,V>

public class UniversalCache<K,V>
extends java.lang.Object

UniversalCache - A universal cache.

Author:
Thorben Betten

Nested Class Summary
static interface UniversalCache.ValueYielder<K,V>
          The value yielder interface.
 
Constructor Summary
UniversalCache(UniversalCache.ValueYielder<K,V> yielder)
          Initializes a new UniversalCache.
 
Method Summary
 void clear()
          Clears the cache-
 V get(K k)
          Gets the result when passing specified input to yielder.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniversalCache

public UniversalCache(UniversalCache.ValueYielder<K,V> yielder)
Initializes a new UniversalCache.

Method Detail

get

public V get(K k)
      throws java.lang.InterruptedException
Gets the result when passing specified input to yielder.

Parameters:
k - The input.
Returns:
The (cached) result.
Throws:
java.lang.InterruptedException - If current thread is interrupted while waiting for result being yielded.

clear

public void clear()
Clears the cache-