net.sf.molae.pipe.genimpl
Class ListBackedMapEntry<K,V>

java.lang.Object
  extended by net.sf.molae.pipe.basic.AbstractMapEntry<K,V>
      extended by net.sf.molae.pipe.genimpl.ListBackedMapEntry<K,V>
All Implemented Interfaces:
Map.Entry<K,V>

public final class ListBackedMapEntry<K,V>
extends AbstractMapEntry<K,V>

A map entry pointing to a list element with a specified index.

Since:
1.1

Constructor Summary
ListBackedMapEntry(K key, List<V> base, int index)
          Constructs a ListBackedMapEntry.
 
Method Summary
 V getValue()
           
 V setValue(V value)
          Replaces the value corresponding to this entry with the specified value.
 
Methods inherited from class net.sf.molae.pipe.basic.AbstractMapEntry
equals, getKey, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListBackedMapEntry

public ListBackedMapEntry(K key,
                          List<V> base,
                          int index)
Constructs a ListBackedMapEntry.

Parameters:
key - key of the entry
base - a list containing the value of this entry
index - of the value of this entry
Method Detail

getValue

public V getValue()
Specified by:
getValue in interface Map.Entry<K,V>
Specified by:
getValue in class AbstractMapEntry<K,V>

setValue

public V setValue(V value)
Replaces the value corresponding to this entry with the specified value.

Specified by:
setValue in interface Map.Entry<K,V>
Overrides:
setValue in class AbstractMapEntry<K,V>
Parameters:
value - new value to be stored in this entry
Returns:
old value corresponding to the entry.
Throws:
UnsupportedOperationException - if the set operation is not supported by the backing list.
ClassCastException - depending on the base list
IllegalArgumentException - depending on the base list
See Also:
getValue()