ca.infoway.messagebuilder.j5goodies
Class MapOfMaps<K1,K2,V>

Package class diagram package MapOfMaps
java.lang.Object
  extended by ca.infoway.messagebuilder.j5goodies.MapOfMaps<K1,K2,V>
Type Parameters:
K1 - - the type of the outer map key.
K2 - - the type of the inner map key.
V - - the type of the map value.
All Implemented Interfaces:
Map<K1,Map<K2,V>>

public class MapOfMaps<K1,K2,V>
extends Object
implements Map<K1,Map<K2,V>>

This class provides simple semantics for the common situation where you want to have a map that contains other maps.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
MapOfMaps()
           
 
Method Summary
 void clear()
          
 boolean containsKey(K1 key1, K2 key2)
          Determine if the map contains a compound key.
 boolean containsKey(Object key)
          
 boolean containsValue(Object value)
          
 Set<Map.Entry<K1,Map<K2,V>>> entrySet()
          
 V get(K1 key1, K2 key2)
          Get the value.
 Map<K2,V> get(Object key)
          
 boolean isEmpty()
          
 Set<K1> keySet()
          
 void put(K1 key1, K2 key2, V value)
          Put the value.
 Map<K2,V> put(K1 key, Map<K2,V> value)
          
 void putAll(Map<? extends K1,? extends Map<K2,V>> t)
          
 Map<K2,V> remove(Object key)
          
 int size()
          
 String toString()
          
 Collection<Map<K2,V>> values()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

MapOfMaps

public MapOfMaps()
Method Detail

clear

public void clear()

Specified by:
clear in interface Map<K1,Map<K2,V>>

containsKey

public boolean containsKey(Object key)

Specified by:
containsKey in interface Map<K1,Map<K2,V>>

containsValue

public boolean containsValue(Object value)

Specified by:
containsValue in interface Map<K1,Map<K2,V>>

entrySet

public Set<Map.Entry<K1,Map<K2,V>>> entrySet()

Specified by:
entrySet in interface Map<K1,Map<K2,V>>

get

public Map<K2,V> get(Object key)

Specified by:
get in interface Map<K1,Map<K2,V>>

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface Map<K1,Map<K2,V>>

keySet

public Set<K1> keySet()

Specified by:
keySet in interface Map<K1,Map<K2,V>>

put

public Map<K2,V> put(K1 key,
                     Map<K2,V> value)

Specified by:
put in interface Map<K1,Map<K2,V>>

putAll

public void putAll(Map<? extends K1,? extends Map<K2,V>> t)

Specified by:
putAll in interface Map<K1,Map<K2,V>>

remove

public Map<K2,V> remove(Object key)

Specified by:
remove in interface Map<K1,Map<K2,V>>

size

public int size()

Specified by:
size in interface Map<K1,Map<K2,V>>

values

public Collection<Map<K2,V>> values()

Specified by:
values in interface Map<K1,Map<K2,V>>

put

public void put(K1 key1,
                K2 key2,
                V value)

Put the value.

Parameters:
key1 - - the key of the outer map.
key2 - - the key of the innter map.
value - - the new value

containsKey

public boolean containsKey(K1 key1,
                           K2 key2)

Determine if the map contains a compound key.

Parameters:
key1 - - the key of the outer map.
key2 - - the key of the innter map.
Returns:
true if the map contains the compound key; false otherwise.

get

public V get(K1 key1,
             K2 key2)

Get the value.

Parameters:
key1 - - the key of the outer map.
key2 - - the key of the innter map.
Returns:
the value

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.