net.sf.molae.pipe.keyed
Class KeyedSetAsMap

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--net.sf.molae.pipe.keyed.KeyedSetAsMap
All Implemented Interfaces:
Map

public final class KeyedSetAsMap
extends AbstractMap

A set of Keyed objects represented as a map. The performance of this map is not good, so it should be used for transformtion only.


Inner classes inherited from class java.util.Map
Map.Entry
 
Constructor Summary
KeyedSetAsMap(Collection base)
          Creates a new map from the specified collection of keyed objects.
 
Method Summary
 void clear()
          Removes all mappings from the base set.
 boolean containsValue(Object value)
           
 Set entrySet()
           
 Object put(Object key, Object value)
           
 int size()
           
 Collection values()
           
 
Methods inherited from class java.util.AbstractMap
containsKey, equals, get, hashCode, isEmpty, keySet, putAll, remove, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyedSetAsMap

public KeyedSetAsMap(Collection base)
Creates a new map from the specified collection of keyed objects.
Parameters:
base - the underlying collection of keyed objects
Throws:
ClassCastException - if any element of the collection is not a Keyed object.
NullPointerException - if the specified collection is null.
Method Detail

size

public int size()
Overrides:
size in class AbstractMap

containsValue

public boolean containsValue(Object value)
Overrides:
containsValue in class AbstractMap

put

public Object put(Object key,
                  Object value)
Overrides:
put in class AbstractMap
Throws:
ClassCastException - value is not a Keyed object or the base set does not allow the class of the specified object
IllegalArgumentException - The specified key is not the key of the specified value or the base set does not allow the specified value
NullPointerException - if value is null
UnsupportedOperationException - if the base set does not allow new values

clear

public void clear()
Removes all mappings from the base set.
Overrides:
clear in class AbstractMap
Throws:
UnsupportedOperationException - depending on the base set

values

public Collection values()
Overrides:
values in class AbstractMap

entrySet

public Set entrySet()
Overrides:
entrySet in class AbstractMap