org.jjoost.collections.maps.nested
Class NestedSetListMap<K,V>

java.lang.Object
  extended by org.jjoost.collections.maps.nested.NestedSetMap<K,V,MultiSet<V>>
      extended by org.jjoost.collections.maps.nested.NestedSetListMap<K,V>
All Implemented Interfaces:
java.io.Serializable, AnyMap<K,V>, AnyReadMap<K,V>, ListMap<K,V>, Function<K,java.lang.Iterable<V>>

public class NestedSetListMap<K,V>
extends NestedSetMap<K,V,MultiSet<V>>
implements ListMap<K,V>

See Also:
Serialized Form

Constructor Summary
NestedSetListMap(Map<K,MultiSet<V>> map, Equality<? super V> valueEq, Factory<MultiSet<V>> factory)
           
 
Method Summary
 java.lang.Iterable<V> apply(K v)
          Returns the result of applying the function to the parameter
 ListMap<K,V> copy()
          Returns a copy of the map.
 MultiSet<java.util.Map.Entry<K,V>> entries()
          Returns a set representing all the key->value pairs in this map.
 
Methods inherited from class org.jjoost.collections.maps.nested.NestedSetMap
add, clear, clearAndReturn, contains, contains, count, count, entries, first, inverse, isEmpty, keys, list, permitsDuplicateKeys, put, putIfAbsent, remove, remove, removeAndReturn, removeAndReturn, removeAndReturnFirst, shrink, totalCount, uniqueKeyCount, values, values
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jjoost.collections.ListMap
keys, put, putIfAbsent, values
 
Methods inherited from interface org.jjoost.collections.AnyMap
add, clear, clearAndReturn, inverse, remove, remove, removeAndReturn, removeAndReturn, removeAndReturnFirst, shrink, values
 
Methods inherited from interface org.jjoost.collections.AnyReadMap
contains, contains, count, count, entries, first, isEmpty, list, permitsDuplicateKeys, totalCount, uniqueKeyCount
 

Constructor Detail

NestedSetListMap

public NestedSetListMap(Map<K,MultiSet<V>> map,
                        Equality<? super V> valueEq,
                        Factory<MultiSet<V>> factory)
Method Detail

entries

public MultiSet<java.util.Map.Entry<K,V>> entries()
Description copied from interface: AnyReadMap
Returns a set representing all the key->value pairs in this map. In a ListMap this will be a MultiSet. This set should always reflect changes to the map, and changes to the set should be reflected in the map also. Otherwise, this set should behave exactly as a regular set does.

Specified by:
entries in interface AnyMap<K,V>
Specified by:
entries in interface AnyReadMap<K,V>
Specified by:
entries in interface ListMap<K,V>
Returns:
the entry set< k>

apply

public java.lang.Iterable<V> apply(K v)
Description copied from interface: Function
Returns the result of applying the function to the parameter

Specified by:
apply in interface Function<K,java.lang.Iterable<V>>
Parameters:
v - something of type domain
Returns:
the result of the function (something of type range)

copy

public ListMap<K,V> copy()
Description copied from interface: AnyMap
Returns a copy of the map. Note that this method may not necessarily return an object of the same class as the one it is called upon, but will return one indistinguishable from it with respect to all method calls.

Specified by:
copy in interface AnyMap<K,V>
Specified by:
copy in interface ListMap<K,V>
Returns:
the any map< k, v>