mondrian.util
Class CacheMap<S,T>

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

public class CacheMap<S,T>
extends java.lang.Object
implements java.util.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
java.util.Map.Entry<K,V>
 
Constructor Summary
CacheMap(int size)
          Creates an empty map with limited size.
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set entrySet()
           
 boolean equals(java.lang.Object o)
           
 T get(java.lang.Object key)
           
 int hashCode()
           
 boolean isEmpty()
           
 java.util.Set<S> keySet()
           
 T put(S key, T value)
           
 void putAll(java.util.Map t)
           
 T remove(java.lang.Object key)
           
 int size()
           
 java.lang.String toString()
           
 java.util.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 java.util.Map<S,T>

containsKey

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

containsValue

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

entrySet

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

get

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

isEmpty

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

keySet

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

put

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

putAll

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

remove

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

size

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

values

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

hashCode

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

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

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads