org.apache.lucene.util

## Class MapOfSets

- java.lang.Object
- - org.apache.lucene.util.MapOfSets

-     public class MapOfSets
      extends java.lang.Object

  Helper class for keeping Lists of Objects associated with keys. WARNING: THIS CLASS IS NOT THREAD SAFE

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapOfSets(java.util.Map m)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Map` | `getMap()`
    `int` | `put(java.lang.Object key, java.lang.Object val)` Adds val to the Set associated with key in the Map.
    `int` | `putAll(java.lang.Object key, java.util.Collection vals)` Adds multiple vals to the Set associated with key in the Map.

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

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

- - ### Constructor Detail

    - #### MapOfSets

          public MapOfSets(java.util.Map m)

      Parameters:
        `m` - the backing store for this object

  - ### Method Detail

    - #### getMap

          public java.util.Map getMap()

      Returns:
        direct access to the map backing this object.

    - #### put

          public int put(java.lang.Object key,
                         java.lang.Object val)

      Adds val to the Set associated with key in the Map. If key is not already in the map, a new Set will first be created.
      Returns:
        the size of the Set associated with key once val is added to it.

    - #### putAll

          public int putAll(java.lang.Object key,
                            java.util.Collection vals)

      Adds multiple vals to the Set associated with key in the Map. If key is not already in the map, a new Set will first be created.
      Returns:
        the size of the Set associated with key once val is added to it.

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.