bpiwowar.argparser.utils
Class TreeMapArray<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.TreeMap<K,ArrayList<V>>
          extended by bpiwowar.argparser.utils.TreeMapArray<K,V>
Type Parameters:
K -
V -
All Implemented Interfaces:
Serializable, Cloneable, Map<K,ArrayList<V>>, NavigableMap<K,ArrayList<V>>, SortedMap<K,ArrayList<V>>

public class TreeMapArray<K,V>
extends TreeMap<K,ArrayList<V>>

A TreeMap where a value is an ArrayList of a given type

Author:
Benjamin Piwowarski
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
TreeMapArray()
           
TreeMapArray(Comparator<? super K> c)
           
TreeMapArray(Map<? extends K,? extends ArrayList<V>> m)
           
TreeMapArray(SortedMap<K,? extends ArrayList<V>> m)
           
 
Method Summary
 void add(K key, V value)
          Add a new value to the array list for a given key
 void addAll(K key, Collection<? extends V> values)
           
static
<K,V> TreeMapArray<K,V>
newInstance()
           
static
<K,V> TreeMapArray<K,V>
newInstance(Comparator<? super K> comparator)
           
 
Methods inherited from class java.util.TreeMap
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, size, subMap, subMap, tailMap, tailMap, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode, isEmpty
 

Constructor Detail

TreeMapArray

public TreeMapArray()

TreeMapArray

public TreeMapArray(Comparator<? super K> c)

TreeMapArray

public TreeMapArray(Map<? extends K,? extends ArrayList<V>> m)

TreeMapArray

public TreeMapArray(SortedMap<K,? extends ArrayList<V>> m)
Method Detail

add

public void add(K key,
                V value)
Add a new value to the array list for a given key

Parameters:
key -
value -

newInstance

public static <K,V> TreeMapArray<K,V> newInstance()

newInstance

public static <K,V> TreeMapArray<K,V> newInstance(Comparator<? super K> comparator)

addAll

public void addAll(K key,
                   Collection<? extends V> values)


Copyright © 2013. All Rights Reserved.