mondrian.util
Class CacheMap<S,T>

java.lang.Object
  extended by mondrian.util.CacheMap<S,T>
All Implemented Interfaces:
Map<S,T>

public class CacheMap<S,T>
extends Object
implements Map<S,T>

Map with limited size to be used as cache.

Author:
lcanals, www.tasecurity.net
 

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
CacheMap(int size)
          Creates an empty map with limited size.
 
Method Summary
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set entrySet()
           
 boolean equals(Object o)
           
 T get(Object key)
           
 int hashCode()
           
 boolean isEmpty()
           
 Set<S> keySet()
           
 T put(S key, T value)
           
 void putAll(Map t)
           
 T remove(Object key)
           
 int size()
           
 String toString()
           
 Collection<T> values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheMap

public CacheMap(int size)
Creates an empty map with limited size.

Parameters:
size - Maximum number of mapped elements.
Method Detail

clear

public void clear()
Specified by:
clear in interface Map<S,T>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<S,T>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<S,T>

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map<S,T>

get

public T get(Object key)
Specified by:
get in interface Map<S,T>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<S,T>

keySet

public Set<S> keySet()
Specified by:
keySet in interface Map<S,T>

put

public T put(S key,
             T value)
Specified by:
put in interface Map<S,T>

putAll

public void putAll(Map t)
Specified by:
putAll in interface Map<S,T>

remove

public T remove(Object key)
Specified by:
remove in interface Map<S,T>

size

public int size()
Specified by:
size in interface Map<S,T>

values

public Collection<T> values()
Specified by:
values in interface Map<S,T>

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<S,T>
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Specified by:
equals in interface Map<S,T>
Overrides:
equals in class Object

SourceForge.net_Logo