org.jboss.serial.util
Class PartitionedWeakHashMap

java.lang.Object
  extended by java.util.AbstractMap
      extended by org.jboss.serial.util.PartitionedWeakHashMap
All Implemented Interfaces:
java.util.Map

public class PartitionedWeakHashMap
extends java.util.AbstractMap

This is a WeakHashMap divided into partitions, using a simple algorithm of using the hashCode of a Key % numberOfPartitions to determine what partition to use. This is intended to minimize synchroniozation affects

Author:
Clebert Suconic

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
PartitionedWeakHashMap()
           
PartitionedWeakHashMap(boolean issynchronized)
           
 
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)
           
 java.lang.Object get(java.lang.Object key)
           
 java.util.Map getMap(java.lang.Object obj)
           
 boolean isEmpty()
           
 java.util.Set keySet()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map elementsToAdd)
           
 java.lang.Object remove(java.lang.Object key)
           
 int size()
           
 java.util.Collection values()
           
 
Methods inherited from class java.util.AbstractMap
hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PartitionedWeakHashMap

public PartitionedWeakHashMap()

PartitionedWeakHashMap

public PartitionedWeakHashMap(boolean issynchronized)
Method Detail

getMap

public java.util.Map getMap(java.lang.Object obj)

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map
Specified by:
entrySet in class java.util.AbstractMap

clear

public void clear()
Specified by:
clear in interface java.util.Map
Overrides:
clear in class java.util.AbstractMap

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map
Overrides:
containsKey in class java.util.AbstractMap

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map
Overrides:
containsValue in class java.util.AbstractMap

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Map
Overrides:
equals in class java.util.AbstractMap

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map
Overrides:
get in class java.util.AbstractMap

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map
Overrides:
isEmpty in class java.util.AbstractMap

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map
Overrides:
keySet in class java.util.AbstractMap

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map
Overrides:
put in class java.util.AbstractMap

putAll

public void putAll(java.util.Map elementsToAdd)
Specified by:
putAll in interface java.util.Map
Overrides:
putAll in class java.util.AbstractMap

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
Overrides:
remove in class java.util.AbstractMap

size

public int size()
Specified by:
size in interface java.util.Map
Overrides:
size in class java.util.AbstractMap

values

public java.util.Collection values()
Specified by:
values in interface java.util.Map
Overrides:
values in class java.util.AbstractMap


JBoss Serialization, a new approach to java-serialization.