public class HashMap3D<K1 extends java.lang.Comparable,K2 extends java.lang.Comparable,K3 extends java.lang.Comparable,V> extends java.lang.Object implements Map3D<K1,K2,K3,V>
The three dimensional map is implemented using a regular map with keys formed by concatenating the toString() values of individual keys.
Example of use:
HashMap3D map = new HashMap3D(); map.put( "a" , "b" , "c" , "my value" ); String s = map.get( "a" , "b" , "c" );
Note: HashMap3D does not implement the Map interface.
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<K1,java.util.Map<K2,java.util.Map<K3,V>>> |
localMap
The map used to hold the multikey data.
|
Constructor and Description |
---|
HashMap3D()
Create three dimensional hash map.
|
HashMap3D(int initialCapacity)
Create three dimensional map with specified initial row capacity.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all entries.
|
java.util.Set<K2> |
columnKeySet()
Get column key set.
|
boolean |
containsKey(CompoundKey key)
Determine if map contains a compound key.
|
boolean |
containsKeys(java.lang.Object rowKey,
java.lang.Object columnKey,
java.lang.Object sliceKey)
Determine if map contains a key triple.
|
V |
get(CompoundKey key)
Get value at specified CompoundKey position.
|
V |
get(java.lang.Object rowKey,
java.lang.Object columnKey,
java.lang.Object sliceKey)
Get value at specified (rowKey, columnKey, sliceKey) position.
|
java.util.Iterator<CompoundKey> |
iterator()
Get iterator over keys.
|
java.util.Set<CompoundKey> |
keySet()
Get the compound key set.
|
V |
put(K1 rowKey,
K2 columnKey,
K3 sliceKey,
V value)
Add value for specified (rowKey, columnKey, sliceKey).
|
V |
remove(java.lang.Object rowKey,
java.lang.Object columnKey,
java.lang.Object sliceKey)
Remove entry at (rowKey, columnKey, sliceKey).
|
java.util.Set<K1> |
rowKeySet()
Get row key set.
|
int |
size()
Return number of entries.
|
java.util.Set<K3> |
sliceKeySet()
Get slice key set.
|
java.lang.String |
toString()
Return formatted string displaying all entries.
|
public HashMap3D()
public HashMap3D(int initialCapacity)
initialCapacity
- public void clear()
public int size()
public boolean containsKeys(java.lang.Object rowKey, java.lang.Object columnKey, java.lang.Object sliceKey)
public boolean containsKey(CompoundKey key)
public V get(java.lang.Object rowKey, java.lang.Object columnKey, java.lang.Object sliceKey)
public V get(CompoundKey key)
public V put(K1 rowKey, K2 columnKey, K3 sliceKey, V value)
put
in interface Map3D<K1 extends java.lang.Comparable,K2 extends java.lang.Comparable,K3 extends java.lang.Comparable,V>
rowKey
- Row key.columnKey
- Column key.sliceKey
- Slice key.value
- Value to store.public V remove(java.lang.Object rowKey, java.lang.Object columnKey, java.lang.Object sliceKey)
public java.util.Set<CompoundKey> keySet()
public java.util.Set<K1> rowKeySet()
public java.util.Set<K2> columnKeySet()
public java.util.Set<K3> sliceKeySet()
public java.util.Iterator<CompoundKey> iterator()
public java.lang.String toString()
toString
in class java.lang.Object