public class TwoDimensionalMap<K1,K2,V> extends java.lang.Object implements java.io.Serializable, java.lang.Iterable<TwoDimensionalMap.Entry<K1,K2,V>>
Modifier and Type | Class and Description |
---|---|
static class |
TwoDimensionalMap.Entry<K1,K2,V>
This inner class represents a single entry in the TwoDimensionalMap.
|
Constructor and Description |
---|
TwoDimensionalMap() |
TwoDimensionalMap(MapFactory<K1,java.util.Map<K2,V>> mf1,
MapFactory<K2,V> mf2) |
TwoDimensionalMap(TwoDimensionalMap<K1,K2,V> tdm) |
Modifier and Type | Method and Description |
---|---|
<V2> void |
addAll(TwoDimensionalMap<? extends K1,? extends K2,? extends V2> other,
java.util.function.Function<V2,V> function)
Adds all of the entries in the
other map, performing
function on them to transform the values |
void |
clear() |
boolean |
contains(K1 key1,
K2 key2) |
boolean |
containsKey(K1 key1) |
boolean |
equals(java.lang.Object o) |
java.util.Set<K1> |
firstKeySet() |
java.util.Map<K2,V> |
get(K1 key1) |
V |
get(K1 key1,
K2 key2) |
java.util.Map<K2,V> |
getMap(K1 key1) |
int |
hashCode() |
static <K1,K2,V> TwoDimensionalMap<K1,K2,V> |
hashMap() |
static <K1,K2,V> TwoDimensionalMap<K1,K2,V> |
identityHashMap() |
boolean |
isEmpty() |
java.util.Iterator<TwoDimensionalMap.Entry<K1,K2,V>> |
iterator()
Iterate over the map using the iterator and entry inner classes.
|
void |
put(K1 key1) |
V |
put(K1 key1,
K2 key2,
V value) |
void |
remove(K1 key1)
Removes all of the data associated with the first key in the map
|
V |
remove(K1 key1,
K2 key2) |
void |
replaceAll(java.util.function.Function<V,? extends V> f)
Replace each of the elements with the application of a function.
|
java.util.Set<K2> |
secondKeySet() |
int |
size() |
java.lang.String |
toString() |
<V2> TwoDimensionalMap<K1,K2,V2> |
transform(java.util.function.Function<V,V2> function)
Transforms this map into a new map using the given transform function.
|
static <K1,K2,V> TwoDimensionalMap<K1,K2,V> |
treeMap() |
java.util.Iterator<V> |
valueIterator() |
java.util.Collection<V> |
values() |
public TwoDimensionalMap()
public TwoDimensionalMap(TwoDimensionalMap<K1,K2,V> tdm)
public TwoDimensionalMap(MapFactory<K1,java.util.Map<K2,V>> mf1, MapFactory<K2,V> mf2)
public int size()
public boolean isEmpty()
public void put(K1 key1)
public void remove(K1 key1)
public void clear()
public boolean containsKey(K1 key1)
public java.util.Collection<V> values()
public java.util.Set<K1> firstKeySet()
public java.util.Set<K2> secondKeySet()
public <V2> void addAll(TwoDimensionalMap<? extends K1,? extends K2,? extends V2> other, java.util.function.Function<V2,V> function)
other
map, performing
function
on them to transform the valuespublic <V2> TwoDimensionalMap<K1,K2,V2> transform(java.util.function.Function<V,V2> function)
public void replaceAll(java.util.function.Function<V,? extends V> f)
public static <K1,K2,V> TwoDimensionalMap<K1,K2,V> hashMap()
public static <K1,K2,V> TwoDimensionalMap<K1,K2,V> treeMap()
public static <K1,K2,V> TwoDimensionalMap<K1,K2,V> identityHashMap()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.Iterator<TwoDimensionalMap.Entry<K1,K2,V>> iterator()
iterator
in interface java.lang.Iterable<TwoDimensionalMap.Entry<K1,K2,V>>
public java.util.Iterator<V> valueIterator()