org.jboss.cache.util
Class MinMapUtil

java.lang.Object
  extended by org.jboss.cache.util.MinMapUtil

public class MinMapUtil
extends java.lang.Object

Minimizes Map memory usage by changing the map instance based on the number of stored entries.

Author:
Elias Ross

Method Summary
static
<K,V> java.util.Map<K,V>
put(java.util.Map<K,V> map, K key, V value)
          Puts a mapping into a map, returns a map with the mapping.
static
<K,V> java.util.Map<K,V>
putAll(java.util.Map<K,V> dest, java.util.Map<K,V> src)
          Puts a number of entries into a map, returns a map.
static
<K,V> java.util.Map<K,V>
remove(java.util.Map<K,V> map, K key)
          Removes a mapping by key from a map, returns the map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

put

public static <K,V> java.util.Map<K,V> put(java.util.Map<K,V> map,
                                           K key,
                                           V value)
Puts a mapping into a map, returns a map with the mapping.

Parameters:
map - destination

putAll

public static <K,V> java.util.Map<K,V> putAll(java.util.Map<K,V> dest,
                                              java.util.Map<K,V> src)
Puts a number of entries into a map, returns a map.

Parameters:
dest - destination map
src - source map

remove

public static <K,V> java.util.Map<K,V> remove(java.util.Map<K,V> map,
                                              K key)
Removes a mapping by key from a map, returns the map.



Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.