lev

## Class LMergeMap<K,V>

- java.lang.Object
- - lev.LMergeMap<K,V>

- Type Parameters:
    `K` -
    `V` -
  All Implemented Interfaces:
    java.lang.Iterable<V>

      public class LMergeMap<K,V>
      extends java.lang.Object
      implements java.lang.Iterable<V>

  A map which has values which are ArrayLists of type V.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LMergeMap(java.lang.Boolean sorted)`
    `LMergeMap(java.lang.Boolean sorted, java.lang.Boolean unique)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAll(LMergeMap<K,V> in)`
    `void` | `clear()`
    `boolean` | `containsKey(K key)`
    `boolean` | `containsValue(V value)`
    `java.util.Set<java.util.Map.Entry<K,java.util.ArrayList<V>>>` | `entrySet()`
    `java.util.Map<K,V>` | `flatten()`
    `LMergeMap<V,K>` | `flip()` Flips the mergemap so keys become values.
    `java.util.ArrayList<V>` | `get(K key)`
    `int` | `hashcode()`
    `boolean` | `isEmpty()`
    `java.util.Iterator<V>` | `iterator()`
    `java.util.Set<K>` | `keySet()`
    `int` | `numVals()`
    `java.util.ArrayList<java.lang.String>` | `print()`
    `void` | `put(K key, java.util.ArrayList<V> value)`
    `void` | `put(K key, V value)`
    `void` | `remove(K key)`
    `int` | `size()`
    `java.util.Collection<java.util.ArrayList<V>>` | `values()`
    `java.util.ArrayList<V>` | `valuesFlat()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LMergeMap

          public LMergeMap(java.lang.Boolean sorted)

      Parameters:
        `sorted` - Whether to use TreeMap as the container.

    - #### LMergeMap

          public LMergeMap(java.lang.Boolean sorted,
                   java.lang.Boolean unique)

      Parameters:
        `sorted` - Whether to use TreeMap as the container.
        `unique` - Whether to check for object uniqueness before adding to the list.

  - ### Method Detail

    - #### clear

          public void clear()

    - #### addAll

          public void addAll(LMergeMap<K,V> in)

      Parameters:
        `in` -

    - #### containsKey

          public boolean containsKey(K key)

      Parameters:
        `key` -
      Returns:

    - #### containsValue

          public boolean containsValue(V value)

      Parameters:
        `value` -
      Returns:

    - #### entrySet

          public java.util.Set<java.util.Map.Entry<K,java.util.ArrayList<V>>> entrySet()

      Returns:

    - #### get

          public java.util.ArrayList<V> get(K key)

      Parameters:
        `key` -
      Returns:

    - #### hashcode

          public int hashcode()

      Returns:

    - #### isEmpty

          public boolean isEmpty()

      Returns:

    - #### keySet

          public java.util.Set<K> keySet()

      Returns:

    - #### put

          public void put(K key,
                 V value)

      Parameters:
        `key` -
        `value` -

    - #### put

          public void put(K key,
                 java.util.ArrayList<V> value)

      Parameters:
        `key` -
        `value` -

    - #### remove

          public void remove(K key)

      Parameters:
        `key` -

    - #### size

          public int size()

      Returns:

    - #### numVals

          public int numVals()

      Returns:
        Number of real values in the MergeMap; Not the number of Key<>ArrayList combinations

    - #### values

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

      Returns:

    - #### valuesFlat

          public java.util.ArrayList<V> valuesFlat()

      Returns:
        All values in the mergemap.

    - #### flatten

          public java.util.Map<K,V> flatten()

      Returns:
        A map with the first value of each key.

    - #### flip

          public LMergeMap<V,K> flip()

      Flips the mergemap so keys become values.
      Returns:

    - #### print

          public java.util.ArrayList<java.lang.String> print()

      Returns:

    - #### iterator

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

      Specified by:
        `iterator` in interface `java.lang.Iterable<V>`