net.sf.molae.pipe.genimpl
Class ListsBackedMap

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--net.sf.molae.pipe.basic.AbstractMapWithSet
              |
              +--net.sf.molae.pipe.genimpl.ListsBackedMap
All Implemented Interfaces:
Map

public final class ListsBackedMap
extends AbstractMapWithSet

This class implements the map interface using a list of keys and a list of values. Null values are allowed. Null keys are not allowed.

Since:
1.1

Inner classes inherited from class net.sf.molae.pipe.basic.AbstractMapWithSet
AbstractMapWithSet.EntrySet
 
Inner classes inherited from class java.util.Map
Map.Entry
 
Constructor Summary
ListsBackedMap(List keys)
          Constructs a new ListsBackedMap.
ListsBackedMap(List keys, List valueList)
          Constructs a new ListsBackedMap.
 
Method Summary
 void clear()
           
 boolean containsValue(Object value)
           
 Object get(Object key)
           
protected  Iterator getEntrySetIterator()
          Returns the iterator of the entry set.
 Object put(Object key, Object value)
           
 Object remove(Object key)
           
 Collection values()
           
 
Methods inherited from class net.sf.molae.pipe.basic.AbstractMapWithSet
entrySet, keySet, size
 
Methods inherited from class java.util.AbstractMap
containsKey, equals, hashCode, isEmpty, putAll, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListsBackedMap

public ListsBackedMap(List keys,
                      List valueList)
Constructs a new ListsBackedMap.
Parameters:
keys - keys of the map
valueList - values of the map
Throws:
NullPointerException - if any of the specified objects is null

ListsBackedMap

public ListsBackedMap(List keys)
Constructs a new ListsBackedMap.
Parameters:
keys - keys of the map
Throws:
NullPointerException - if any of the specified objects is null
Method Detail

containsValue

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

get

public Object get(Object key)
Overrides:
get in class AbstractMap

put

public Object put(Object key,
                  Object value)
Overrides:
put in class AbstractMap

remove

public Object remove(Object key)
Overrides:
remove in class AbstractMap

clear

public void clear()
Overrides:
clear in class AbstractMap

values

public Collection values()
Overrides:
values in class AbstractMap

getEntrySetIterator

protected Iterator getEntrySetIterator()
Description copied from class: AbstractMapWithSet
Returns the iterator of the entry set.
Overrides:
getEntrySetIterator in class AbstractMapWithSet
Following copied from class: net.sf.molae.pipe.basic.AbstractMapWithSet
Returns:
the iterator of the entry set.