com.miginfocom.util
Class HashMapMap

java.lang.Object
  extended by com.miginfocom.util.HashMapMap

public class HashMapMap
extends java.lang.Object

A map looks up values with thw keys, making it a two dimensional map. Realised by HashMaps in HashMaps.


Constructor Summary
HashMapMap(int mainCap, float mainFillFactor, int subCap, float subFillFactor)
           
 
Method Summary
 boolean contains(java.lang.Object key1, java.lang.Object key2)
          Returns if the key combination exist.
 int firstLevelSize()
          Return how many key in the first map.
 java.lang.Object get(java.lang.Object key1, java.lang.Object key2)
          Returns the value stored under the two keys.
 java.lang.Object put(java.lang.Object key1, java.lang.Object key2, java.lang.Object value)
          Puts a value for two keys.
 java.lang.Object remove(java.lang.Object key1, java.lang.Object key2)
          Removes a value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashMapMap

public HashMapMap(int mainCap,
                  float mainFillFactor,
                  int subCap,
                  float subFillFactor)
Method Detail

get

public java.lang.Object get(java.lang.Object key1,
                            java.lang.Object key2)
Returns the value stored under the two keys.

Parameters:
key1 - First key. Should be the most "unique" one for best performance.
key2 - Second key.
Returns:
The value stored under the two keys.

put

public java.lang.Object put(java.lang.Object key1,
                            java.lang.Object key2,
                            java.lang.Object value)
Puts a value for two keys.

Parameters:
key1 - First key. Should be the most "unique" one for best performance.
key2 - Second key.
value - The value to store. Can be null.
Returns:
The old value stored or null if none.

remove

public java.lang.Object remove(java.lang.Object key1,
                               java.lang.Object key2)
Removes a value.

Parameters:
key1 - First key. Should be the most "unique" one for best performance.
key2 - Second key.
Returns:
The old value stored or null if none.

contains

public boolean contains(java.lang.Object key1,
                        java.lang.Object key2)
Returns if the key combination exist.

Parameters:
key1 - First key. Should be the most "unique" one for best performance.
key2 - Second key.
Returns:
If the key combination exist.

firstLevelSize

public int firstLevelSize()
Return how many key in the first map. There are no way to know the total number of keys.



Copyright © 2009 MiG InfoCom AB. All Rights Reserved.