org.jboss.portal.common.util
Class CollectionMap

java.lang.Object
  extended by org.jboss.portal.common.util.CollectionMap
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ListMap, SetMap

public abstract class CollectionMap
extends java.lang.Object
implements java.io.Serializable

A map of collections.

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

Field Summary
protected  java.util.Map map
          The underlying map.
 
Constructor Summary
CollectionMap()
           
CollectionMap(SetMap other)
           
 
Method Summary
protected abstract  void add(java.util.Collection c, java.lang.Object o)
           
 boolean contains(java.lang.Object key, java.lang.Object o)
          Return true if the specified set contains the object o.
 java.util.Iterator iterator(java.lang.Object key)
          Return an iterator over the values in the set specified by the key.
 java.util.Set keySet()
          Return the set of keys.
protected abstract  java.util.Collection newCollection()
           
protected abstract  java.util.Collection newCollection(java.util.Collection other)
           
 void put(java.lang.Object key, java.lang.Object o)
          Add an object in the set keyed under the specified key.
protected abstract  void remove(java.util.Collection c, java.lang.Object o)
           
 void remove(java.lang.Object key)
          Remove the entire set of objects specified by the key.
 void remove(java.lang.Object key, java.lang.Object o)
          Remove an object in the set keyed under the specified key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected java.util.Map map
The underlying map.

Constructor Detail

CollectionMap

public CollectionMap()

CollectionMap

public CollectionMap(SetMap other)
              throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException
Method Detail

put

public void put(java.lang.Object key,
                java.lang.Object o)
Add an object in the set keyed under the specified key.


keySet

public java.util.Set keySet()
Return the set of keys.


remove

public void remove(java.lang.Object key)
Remove the entire set of objects specified by the key.


remove

public void remove(java.lang.Object key,
                   java.lang.Object o)
Remove an object in the set keyed under the specified key.


contains

public boolean contains(java.lang.Object key,
                        java.lang.Object o)
Return true if the specified set contains the object o.


iterator

public java.util.Iterator iterator(java.lang.Object key)
Return an iterator over the values in the set specified by the key.


add

protected abstract void add(java.util.Collection c,
                            java.lang.Object o)

remove

protected abstract void remove(java.util.Collection c,
                               java.lang.Object o)

newCollection

protected abstract java.util.Collection newCollection()

newCollection

protected abstract java.util.Collection newCollection(java.util.Collection other)