edu.stanford.nlp.util
Class TwoDimensionalMap<K1,K2,V>

java.lang.Object
  extended by edu.stanford.nlp.util.TwoDimensionalMap<K1,K2,V>
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<TwoDimensionalMap.Entry<K1,K2,V>>

public class TwoDimensionalMap<K1,K2,V>
extends java.lang.Object
implements java.io.Serializable, java.lang.Iterable<TwoDimensionalMap.Entry<K1,K2,V>>

Author:
grenager
See Also:
Serialized Form

Nested Class Summary
static class TwoDimensionalMap.Entry<K1,K2,V>
          This inner class represents a single entry in the TwoDimensionalMap.
 
Constructor Summary
TwoDimensionalMap()
           
TwoDimensionalMap(MapFactory<K1,java.util.Map<K2,V>> mf1, MapFactory<K2,V> mf2)
           
TwoDimensionalMap(TwoDimensionalMap<K1,K2,V> tdm)
           
 
Method Summary
<V2> void
addAll(TwoDimensionalMap<? extends K1,? extends K2,? extends V2> other, 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)
           
 java.util.Set<K2> secondKeySet()
           
 int size()
           
 java.lang.String toString()
           
static
<K1,K2,V> TwoDimensionalMap<K1,K2,V>
treeMap()
           
 java.util.Iterator<V> valueIterator()
           
 java.util.Collection<V> values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TwoDimensionalMap

public TwoDimensionalMap()

TwoDimensionalMap

public TwoDimensionalMap(TwoDimensionalMap<K1,K2,V> tdm)

TwoDimensionalMap

public TwoDimensionalMap(MapFactory<K1,java.util.Map<K2,V>> mf1,
                         MapFactory<K2,V> mf2)
Method Detail

size

public int size()

isEmpty

public boolean isEmpty()

put

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

put

public void put(K1 key1)

contains

public boolean contains(K1 key1,
                        K2 key2)

get

public V get(K1 key1,
             K2 key2)

remove

public V remove(K1 key1,
                K2 key2)

remove

public void remove(K1 key1)
Removes all of the data associated with the first key in the map


clear

public void clear()

containsKey

public boolean containsKey(K1 key1)

get

public java.util.Map<K2,V> get(K1 key1)

getMap

public java.util.Map<K2,V> getMap(K1 key1)

values

public java.util.Collection<V> values()

firstKeySet

public java.util.Set<K1> firstKeySet()

secondKeySet

public java.util.Set<K2> secondKeySet()

addAll

public <V2> void addAll(TwoDimensionalMap<? extends K1,? extends K2,? extends V2> other,
                        Function<V2,V> function)
Adds all of the entries in the other map, performing function on them to transform the values


hashMap

public static <K1,K2,V> TwoDimensionalMap<K1,K2,V> hashMap()

treeMap

public static <K1,K2,V> TwoDimensionalMap<K1,K2,V> treeMap()

identityHashMap

public static <K1,K2,V> TwoDimensionalMap<K1,K2,V> identityHashMap()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

iterator

public java.util.Iterator<TwoDimensionalMap.Entry<K1,K2,V>> iterator()
Iterate over the map using the iterator and entry inner classes.

Specified by:
iterator in interface java.lang.Iterable<TwoDimensionalMap.Entry<K1,K2,V>>

valueIterator

public java.util.Iterator<V> valueIterator()


Stanford NLP Group