org.jboss.cache.util
Class MinMapUtil

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

public class MinMapUtil
extends 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> Map<K,V>
put(Map<K,V> map, K key, V value)
          Puts a mapping into a map, returns a map with the mapping.
static
<K,V> Map<K,V>
putAll(Map<K,V> dest, Map<K,V> src)
          Puts a number of entries into a map, returns a map.
static
<K,V> Map<K,V>
remove(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> Map<K,V> put(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> Map<K,V> putAll(Map<K,V> dest,
                                    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> Map<K,V> remove(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.