Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      org.jboss.portal.common.util.CollectionMap<K,V>

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  ListMap, SetMap

    public abstract class CollectionMap<K,V>

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.Comparator<V>` | `comparator` An optional comparator.

Constructor Summary
`CollectionMap()`
`CollectionMap(CollectionMap<K,V> other)`
`CollectionMap(CollectionMap<K,V> other, java.util.Comparator<V> comparator)`
`CollectionMap(java.util.Comparator<V> comparator)`

Method Summary
`protected abstract void` | `add(java.util.Collection<V> c, V o)`
`boolean` | `contains(K key, java.lang.Object o)` Return true if the specified set contains the object o.
`java.util.Collection<V>` | `get(K key)` Return the collection specified by the key.
`java.util.Iterator<V>` | `iterator(K key)` Return an iterator over the values in the set specified by the key.
`java.util.Set<K>` | `keySet()` Return the set of keys.
`protected abstract java.util.Collection<V>` | `newCollection()`
`protected abstract java.util.Collection<V>` | `newCollection(java.util.Collection<V> other)`
`void` | `put(K key, V o)` Add an object in the set keyed under the specified key.
`protected abstract void` | `remove(java.util.Collection<V> c, java.lang.Object o)` Removes an object from the collection.
`void` | `remove(K key)` Remove the entire set of objects specified by the key.
`void` | `remove(K 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

### comparator

    protected java.util.Comparator<V> comparator

  An optional comparator.

Constructor Detail

### CollectionMap

    public CollectionMap()

### CollectionMap

    public CollectionMap(CollectionMap<K,V> other)
                  throws java.lang.IllegalArgumentException

Throws:
  `java.lang.IllegalArgumentException`

### CollectionMap

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

Throws:
  `java.lang.IllegalArgumentException`

### CollectionMap

    public CollectionMap(java.util.Comparator<V> comparator)

Method Detail

### put

    public final void put(K key,
                          V o)
                   throws java.lang.NullPointerException

  Add an object in the set keyed under the specified key.

  Throws:
    `java.lang.NullPointerException` - if the key is null

### keySet

    public final java.util.Set<K> keySet()

  Return the set of keys.

### remove

    public final void remove(K key)
                      throws java.lang.NullPointerException

  Remove the entire set of objects specified by the key.

  Throws:
    `java.lang.NullPointerException` - if the key is null

### remove

    public final void remove(K key,
                             java.lang.Object o)
                      throws java.lang.NullPointerException

  Remove an object in the set keyed under the specified key.

  Throws:
    `java.lang.NullPointerException` - if the key is null

### contains

    public final boolean contains(K key,
                                  java.lang.Object o)
                           throws java.lang.NullPointerException

  Return true if the specified set contains the object o.

  Throws:
    `java.lang.NullPointerException` - if the key is null

### get

    public java.util.Collection<V> get(K key)

  Return the collection specified by the key.

### iterator

    public final java.util.Iterator<V> iterator(K key)

  Return an iterator over the values in the set specified by the key.

  Throws:
    `java.lang.NullPointerException` - if the key is null

### add

    protected abstract void add(java.util.Collection<V> c,
                                V o)

### remove

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

  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.

  Parameters:
    `c` - the collection to remove from
    `o` - the object to remove

### newCollection

    protected abstract java.util.Collection<V> newCollection()

### newCollection

    protected abstract java.util.Collection<V> newCollection(java.util.Collection<V> other)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD