com.google.caja.util
Class Multimaps.MultimapImpl<K,V,C extends java.util.Collection<V>>

java.lang.Object
  extended by com.google.caja.util.Multimaps.MultimapImpl<K,V,C>
All Implemented Interfaces:
Multimap<K,V>
Enclosing class:
Multimaps

static final class Multimaps.MultimapImpl<K,V,C extends java.util.Collection<V>>
extends java.lang.Object
implements Multimap<K,V>


Field Summary
private  Multimaps.Maker<C> collectionMaker
           
private  Multimaps.Maker<java.util.Map<K,C>> mapMaker
           
private  java.util.Map<K,C> underlying
          Maps to non-empty collections produced by collectionMaker.
 
Constructor Summary
Multimaps.MultimapImpl(Multimaps.Maker<java.util.Map<K,C>> mapMaker, Multimaps.Maker<C> collectionMaker)
           
 
Method Summary
 Multimap<K,V> clone()
           
 java.util.Collection<V> get(K k)
          An immutable collection of all values put for k and not subsequently removed.
 boolean isEmpty()
          True if there are no values in the map.
 java.util.Set<K> keySet()
          The set of keys with a non empty value collection.
 boolean put(K k, V v)
          Adds the given value to the collection of values for the given key.
 void putAll(K k, java.util.Collection<? extends V> v)
           
 boolean remove(K k, V v)
           
 void removeAll(K k, java.util.Collection<? extends V> v)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapMaker

private final Multimaps.Maker<java.util.Map<K,C extends java.util.Collection<V>>> mapMaker

collectionMaker

private final Multimaps.Maker<C extends java.util.Collection<V>> collectionMaker

underlying

private final java.util.Map<K,C extends java.util.Collection<V>> underlying
Maps to non-empty collections produced by collectionMaker.

Constructor Detail

Multimaps.MultimapImpl

Multimaps.MultimapImpl(Multimaps.Maker<java.util.Map<K,C>> mapMaker,
                       Multimaps.Maker<C> collectionMaker)
Method Detail

clone

public final Multimap<K,V> clone()
Specified by:
clone in interface Multimap<K,V>
Overrides:
clone in class java.lang.Object

get

public java.util.Collection<V> get(K k)
Description copied from interface: Multimap
An immutable collection of all values put for k and not subsequently removed.

Specified by:
get in interface Multimap<K,V>

isEmpty

public boolean isEmpty()
Description copied from interface: Multimap
True if there are no values in the map.

Specified by:
isEmpty in interface Multimap<K,V>

keySet

public java.util.Set<K> keySet()
Description copied from interface: Multimap
The set of keys with a non empty value collection.

Specified by:
keySet in interface Multimap<K,V>

put

public boolean put(K k,
                   V v)
Description copied from interface: Multimap
Adds the given value to the collection of values for the given key.

Specified by:
put in interface Multimap<K,V>

putAll

public void putAll(K k,
                   java.util.Collection<? extends V> v)
Specified by:
putAll in interface Multimap<K,V>

remove

public boolean remove(K k,
                      V v)
Specified by:
remove in interface Multimap<K,V>

removeAll

public void removeAll(K k,
                      java.util.Collection<? extends V> v)
Specified by:
removeAll in interface Multimap<K,V>


Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0