org.jboss.portal.common.util
Class SetMap<K,V>

java.lang.Object
  extended by org.jboss.portal.common.util.CollectionMap<K,V>
      extended by org.jboss.portal.common.util.SetMap<K,V>
All Implemented Interfaces:
java.io.Serializable

public class SetMap<K,V>
extends CollectionMap<K,V>

A map of set. This object does not handle synchronization and use HashMap and HashSet as underlying data structures;

Version:
$Revision: 7322 $
Author:
Julien Viet
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.portal.common.util.CollectionMap
comparator
 
Constructor Summary
SetMap()
           
SetMap(java.util.Comparator<V> comparator)
           
SetMap(SetMap<K,V> other)
           
SetMap(SetMap<K,V> other, java.util.Comparator<V> comparator)
           
 
Method Summary
protected  void add(java.util.Collection<V> c, V o)
           
 java.util.Set<V> get(K key)
          Return the set specified by the key.
protected  java.util.Collection<V> newCollection()
           
protected  java.util.Collection<V> newCollection(java.util.Collection<V> other)
           
protected  void remove(java.util.Collection<V> c, java.lang.Object o)
          Removes an object from the collection.
 
Methods inherited from class org.jboss.portal.common.util.CollectionMap
contains, iterator, keySet, put, remove, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetMap

public SetMap()

SetMap

public SetMap(SetMap<K,V> other)
       throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

SetMap

public SetMap(SetMap<K,V> other,
              java.util.Comparator<V> comparator)
       throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

SetMap

public SetMap(java.util.Comparator<V> comparator)
Method Detail

get

public java.util.Set<V> get(K key)
Return the set specified by the key.

Overrides:
get in class CollectionMap<K,V>

add

protected void add(java.util.Collection<V> c,
                   V o)
Specified by:
add in class CollectionMap<K,V>

remove

protected void remove(java.util.Collection<V> c,
                      java.lang.Object o)
Description copied from class: CollectionMap
Removes an object from the collection. The type of the object to remove is intentionnally Object and not the parameterized type because the Collection interface is designed that way.

Specified by:
remove in class CollectionMap<K,V>
Parameters:
c - the collection to remove from
o - the object to remove

newCollection

protected java.util.Collection<V> newCollection()
Specified by:
newCollection in class CollectionMap<K,V>

newCollection

protected java.util.Collection<V> newCollection(java.util.Collection<V> other)
Specified by:
newCollection in class CollectionMap<K,V>