net.sf.extjwnl.util.cache
Class CacheSet<K,A,B>

java.lang.Object
  extended by net.sf.extjwnl.util.cache.CacheSet<K,A,B>
Direct Known Subclasses:
LRUCacheSet

public abstract class CacheSet<K,A,B>
extends Object

A set of Caches, indexed by CacheKey.

Author:
John Didion , Aliaksandr Autayeu

Field Summary
static int DEFAULT_CACHE_CAPACITY
           
 
Constructor Summary
CacheSet(K[] keys)
           
CacheSet(K[] keys, int size)
           
CacheSet(K[] keys, int[] sizes)
           
 
Method Summary
 void addCache(K key)
           
 void addCache(K key, int size)
           
 void cacheObject(K cacheKey, A key, B value)
           
 void clearCache(K key)
           
 void clearObject(K cacheKey, A key)
           
protected abstract  Cache<A,B> createCache(int size)
           
 Cache<A,B> getCache(K cacheKey)
           
 int getCacheCapacity(K cacheKey)
           
 B getCachedObject(K cacheKey, A key)
           
 int getCacheSize(K cacheKey)
           
 int getSize()
           
 int setCacheCapacity(K cacheKey, int capacity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CACHE_CAPACITY

public static final int DEFAULT_CACHE_CAPACITY
See Also:
Constant Field Values
Constructor Detail

CacheSet

public CacheSet(K[] keys)

CacheSet

public CacheSet(K[] keys,
                int size)

CacheSet

public CacheSet(K[] keys,
                int[] sizes)
Method Detail

createCache

protected abstract Cache<A,B> createCache(int size)

addCache

public void addCache(K key)

addCache

public void addCache(K key,
                     int size)

cacheObject

public void cacheObject(K cacheKey,
                        A key,
                        B value)

clearObject

public void clearObject(K cacheKey,
                        A key)

getCachedObject

public B getCachedObject(K cacheKey,
                         A key)

clearCache

public void clearCache(K key)

getCacheSize

public int getCacheSize(K cacheKey)

getCacheCapacity

public int getCacheCapacity(K cacheKey)

setCacheCapacity

public int setCacheCapacity(K cacheKey,
                            int capacity)

getSize

public int getSize()

getCache

public Cache<A,B> getCache(K cacheKey)


Copyright © 2011. All Rights Reserved.