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

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

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

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

Field Summary
protected  java.util.Comparator<V> comparator
          An optional comparator.
 
Constructor Summary
ListMap()
           
ListMap(java.util.Comparator<V> comparator)
           
ListMap(SetMap<K,V> other)
           
ListMap(SetMap<K,V> other, java.util.Comparator<V> comparator)
           
 
Method Summary
protected  void add(java.util.Collection<V> c, V o)
           
 java.util.List<V> get(K key)
          Return the list 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
 

Field Detail

comparator

protected java.util.Comparator<V> comparator
An optional comparator.

Constructor Detail

ListMap

public ListMap()

ListMap

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

ListMap

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

ListMap

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

get

public java.util.List<V> get(K key)
Return the list 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>