net.sf.molae.pipe.genimpl
Class ListsBackedMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
net.sf.molae.pipe.basic.AbstractMapWithSet<K,V>
net.sf.molae.pipe.genimpl.ListsBackedMap<K,V>
- All Implemented Interfaces:
- Map<K,V>
public final class ListsBackedMap<K,V>
- extends AbstractMapWithSet<K,V>
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
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
ListsBackedMap
public ListsBackedMap(List<K> keys,
List<V> valueList)
- Constructs a new ListsBackedMap.
- Parameters:
keys - keys of the mapvalueList - values of the map
- Throws:
NullPointerException - if any of the specified objects
is null
ListsBackedMap
public ListsBackedMap(List<K> keys)
- Constructs a new ListsBackedMap.
- Parameters:
keys - keys of the map
- Throws:
NullPointerException - if any of the specified objects
is null
setTidy
public void setTidy(boolean tidy)
- Specifies if removed map entries are set to
null in
the value list.
If the value is changed from false to true
the list is tidied up.
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue in interface Map<K,V>- Overrides:
containsValue in class AbstractMap<K,V>
get
public V get(Object key)
- Specified by:
get in interface Map<K,V>- Overrides:
get in class AbstractMap<K,V>
put
public V put(K key,
V value)
- Specified by:
put in interface Map<K,V>- Overrides:
put in class AbstractMap<K,V>
remove
public V remove(Object key)
- Specified by:
remove in interface Map<K,V>- Overrides:
remove in class AbstractMap<K,V>
clear
public void clear()
- Specified by:
clear in interface Map<K,V>- Overrides:
clear in class AbstractMap<K,V>
getEntrySetIterator
protected Iterator<Map.Entry<K,V>> getEntrySetIterator()
- Description copied from class:
AbstractMapWithSet
- Returns the iterator of the entry set.
- Specified by:
getEntrySetIterator in class AbstractMapWithSet<K,V>
- Returns:
- the iterator of the entry set.