org.apache.commons.beanutils.locale
Class LocaleConvertUtilsBean.DelegateFastHashMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by org.apache.commons.collections.FastHashMap
              extended by org.apache.commons.beanutils.locale.LocaleConvertUtilsBean.DelegateFastHashMap
All Implemented Interfaces:
Serializable, Cloneable, Map
Enclosing class:
LocaleConvertUtilsBean

private static class LocaleConvertUtilsBean.DelegateFastHashMap
extends FastHashMap

FastHashMap implementation that uses WeakReferences to overcome memory leak problems. This is a hack to retain binary compatibility with previous releases (where FastHashMap is exposed in the API), but use WeakHashMap to resolve memory leaks.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
private  Map map
           
 
Fields inherited from class org.apache.commons.collections.FastHashMap
fast
 
Constructor Summary
private LocaleConvertUtilsBean.DelegateFastHashMap(Map map)
           
 
Method Summary
 void clear()
          Remove all mappings from this map.
 boolean containsKey(Object key)
          Return true if this map contains a mapping for the specified key.
 boolean containsValue(Object value)
          Return true if this map contains one or more keys mapping to the specified value.
 Set entrySet()
          Return a collection view of the mappings contained in this map.
 boolean equals(Object o)
          Compare the specified object with this list for equality.
 Object get(Object key)
          Return the value to which this map maps the specified key.
 boolean getFast()
          Returns true if this map is operating in fast mode.
 int hashCode()
          Return the hash code value for this map.
 boolean isEmpty()
          Return true if this map contains no mappings.
 Set keySet()
          Return a set view of the keys contained in this map.
 Object put(Object key, Object value)
          Associate the specified value with the specified key in this map.
 void putAll(Map m)
          Copy all of the mappings from the specified map to this one, replacing any mappings with the same keys.
 Object remove(Object key)
          Remove any mapping for this key, and return any previously mapped value.
 void setFast(boolean fast)
          Sets whether this map is operating in fast mode.
 int size()
          Return the number of key-value mappings in this map.
 Collection values()
          Return a collection view of the values contained in this map.
 
Methods inherited from class org.apache.commons.collections.FastHashMap
clone
 
Methods inherited from class java.util.AbstractMap
toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

map

private final Map map
Constructor Detail

LocaleConvertUtilsBean.DelegateFastHashMap

private LocaleConvertUtilsBean.DelegateFastHashMap(Map map)
Method Detail

clear

public void clear()
Description copied from class: FastHashMap
Remove all mappings from this map.

Specified by:
clear in interface Map
Overrides:
clear in class FastHashMap

containsKey

public boolean containsKey(Object key)
Description copied from class: FastHashMap
Return true if this map contains a mapping for the specified key.

Specified by:
containsKey in interface Map
Overrides:
containsKey in class FastHashMap
Parameters:
key - the key to be searched for
Returns:
true if the map contains the key

containsValue

public boolean containsValue(Object value)
Description copied from class: FastHashMap
Return true if this map contains one or more keys mapping to the specified value.

Specified by:
containsValue in interface Map
Overrides:
containsValue in class FastHashMap
Parameters:
value - the value to be searched for
Returns:
true if the map contains the value

entrySet

public Set entrySet()
Description copied from class: FastHashMap
Return a collection view of the mappings contained in this map. Each element in the returned collection is a Map.Entry.

Specified by:
entrySet in interface Map
Overrides:
entrySet in class FastHashMap
Returns:
the set of map Map entries

equals

public boolean equals(Object o)
Description copied from class: FastHashMap
Compare the specified object with this list for equality. This implementation uses exactly the code that is used to define the list equals function in the documentation for the Map.equals method.

Specified by:
equals in interface Map
Overrides:
equals in class FastHashMap
Parameters:
o - the object to be compared to this list
Returns:
true if the two maps are equal

get

public Object get(Object key)
Description copied from class: FastHashMap
Return the value to which this map maps the specified key. Returns null if the map contains no mapping for this key, or if there is a mapping with a value of null. Use the containsKey() method to disambiguate these cases.

Specified by:
get in interface Map
Overrides:
get in class FastHashMap
Parameters:
key - the key whose value is to be returned
Returns:
the value mapped to that key, or null

hashCode

public int hashCode()
Description copied from class: FastHashMap
Return the hash code value for this map. This implementation uses exactly the code that is used to define the list hash function in the documentation for the Map.hashCode method.

Specified by:
hashCode in interface Map
Overrides:
hashCode in class FastHashMap
Returns:
suitable integer hash code

isEmpty

public boolean isEmpty()
Description copied from class: FastHashMap
Return true if this map contains no mappings.

Specified by:
isEmpty in interface Map
Overrides:
isEmpty in class FastHashMap
Returns:
is the map currently empty

keySet

public Set keySet()
Description copied from class: FastHashMap
Return a set view of the keys contained in this map.

Specified by:
keySet in interface Map
Overrides:
keySet in class FastHashMap
Returns:
the set of the Map's keys

put

public Object put(Object key,
                  Object value)
Description copied from class: FastHashMap
Associate the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced and returned.

Specified by:
put in interface Map
Overrides:
put in class FastHashMap
Parameters:
key - the key with which the value is to be associated
value - the value to be associated with this key
Returns:
the value previously mapped to the key, or null

putAll

public void putAll(Map m)
Description copied from class: FastHashMap
Copy all of the mappings from the specified map to this one, replacing any mappings with the same keys.

Specified by:
putAll in interface Map
Overrides:
putAll in class FastHashMap
Parameters:
m - the map whose mappings are to be copied

remove

public Object remove(Object key)
Description copied from class: FastHashMap
Remove any mapping for this key, and return any previously mapped value.

Specified by:
remove in interface Map
Overrides:
remove in class FastHashMap
Parameters:
key - the key whose mapping is to be removed
Returns:
the value removed, or null

size

public int size()
Description copied from class: FastHashMap
Return the number of key-value mappings in this map.

Specified by:
size in interface Map
Overrides:
size in class FastHashMap
Returns:
the current size of the map

values

public Collection values()
Description copied from class: FastHashMap
Return a collection view of the values contained in this map.

Specified by:
values in interface Map
Overrides:
values in class FastHashMap
Returns:
the set of the Map's values

getFast

public boolean getFast()
Description copied from class: FastHashMap
Returns true if this map is operating in fast mode.

Overrides:
getFast in class FastHashMap
Returns:
true if this map is operating in fast mode

setFast

public void setFast(boolean fast)
Description copied from class: FastHashMap
Sets whether this map is operating in fast mode.

Overrides:
setFast in class FastHashMap
Parameters:
fast - true if this map should operate in fast mode


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.