edu.northwestern.at.utils

## Class MapUtils

- java.lang.Object
- - edu.northwestern.at.utils.MapUtils

-     public class MapUtils
      extends java.lang.Object

  Map utilities.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `MapUtils()` Don't allow instantiation, do allow overrides.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.Map<java.lang.String,java.lang.String>` | `loadMap(java.io.File mapFile, java.lang.String separator, java.lang.String qualifier, java.lang.String encoding)` Load string map from a file.
    `static java.util.Map<java.lang.String,java.lang.String>` | `loadMap(java.lang.String mapFileName)` Load string map from a file name.
    `static java.util.Map<java.lang.String,java.lang.String>` | `loadMap(java.lang.String mapFileName, java.lang.String separator, java.lang.String qualifier, java.lang.String encoding)` Load string map from a file name.
    `static java.util.Map<java.lang.String,java.lang.String>` | `loadMap(java.net.URL mapURL, java.lang.String separator, java.lang.String qualifier, java.lang.String encoding)` Load string map from a URL.
    `static void` | `saveMap(java.util.Map<?,?> map, java.io.File mapFile, java.lang.String separator, java.lang.String qualifier, java.lang.String encoding)` Save map to a file.
    `static void` | `saveMap(java.util.Map<?,?> map, java.lang.String mapFileName)` Save map to a file name.
    `static void` | `saveMap(java.util.Map<?,?> map, java.lang.String mapFileName, java.lang.String separator, java.lang.String qualifier, java.lang.String encoding)` Save map to a file name.
    `static void` | `saveSortedMap(java.util.Map<?,?> map, java.io.File mapFile, java.lang.String separator, java.lang.String qualifier, java.lang.String encoding)` Save map to a file in sorted key order.
    `static void` | `saveSortedMap(java.util.Map<?,?> map, java.lang.String mapFileName, java.lang.String separator, java.lang.String qualifier, java.lang.String encoding)` Save map to a file name in sorted key order.

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

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

- - ### Constructor Detail

    - #### MapUtils

          protected MapUtils()

      Don't allow instantiation, do allow overrides.

  - ### Method Detail

    - #### loadMap

          public static java.util.Map<java.lang.String,java.lang.String> loadMap(java.net.URL mapURL,
                                                                 java.lang.String separator,
                                                                 java.lang.String qualifier,
                                                                 java.lang.String encoding)
                                                                          throws java.io.IOException,
                                                                                 java.io.FileNotFoundException

      Load string map from a URL.
      Parameters:
        `mapURL` - URL for map file.
        `separator` - Field separator.
        `qualifier` - Quote character.
        `encoding` - Character encoding for the file.
      Returns:
        Map with values read from file.
      Throws:
        `java.io.FileNotFoundException` - If input file does not exist.
        `java.io.IOException` - If input file cannot be opened.

    - #### loadMap

          public static java.util.Map<java.lang.String,java.lang.String> loadMap(java.io.File mapFile,
                                                                 java.lang.String separator,
                                                                 java.lang.String qualifier,
                                                                 java.lang.String encoding)
                                                                          throws java.io.IOException,
                                                                                 java.io.FileNotFoundException

      Load string map from a file.
      Parameters:
        `mapFile` - Map file.
        `separator` - Field separator.
        `qualifier` - Quote character.
        `encoding` - Character encoding for the file.
      Returns:
        Map with values read from file.
      Throws:
        `java.io.FileNotFoundException` - If input file does not exist.
        `java.io.IOException` - If input file cannot be opened.

    - #### loadMap

          public static java.util.Map<java.lang.String,java.lang.String> loadMap(java.lang.String mapFileName,
                                                                 java.lang.String separator,
                                                                 java.lang.String qualifier,
                                                                 java.lang.String encoding)
                                                                          throws java.io.IOException,
                                                                                 java.io.FileNotFoundException

      Load string map from a file name.
      Parameters:
        `mapFileName` - Map file name.
        `separator` - Field separator.
        `qualifier` - Quote character.
        `encoding` - Character encoding for the file.
      Returns:
        Map with values read from file name.
      Throws:
        `java.io.FileNotFoundException` - If input file does not exist.
        `java.io.IOException` - If input file cannot be opened.

    - #### loadMap

          public static java.util.Map<java.lang.String,java.lang.String> loadMap(java.lang.String mapFileName)
                                                                          throws java.io.IOException,
                                                                                 java.io.FileNotFoundException

      Load string map from a file name.
      Parameters:
        `mapFileName` - Map file name.
      Returns:
        Map with values read from file name.

        Map is assumed to be utf-8 encoded and have tab-separated values.

      Throws:
        `java.io.FileNotFoundException` - If input file does not exist.
        `java.io.IOException` - If input file cannot be opened.

    - #### saveMap

          public static void saveMap(java.util.Map<?,?> map,
                     java.io.File mapFile,
                     java.lang.String separator,
                     java.lang.String qualifier,
                     java.lang.String encoding)
                              throws java.io.IOException,
                                     java.io.FileNotFoundException

      Save map to a file.
      Parameters:
        `map` - Map to save.
        `mapFile` - Output file name.
        `separator` - Field separator.
        `qualifier` - Quote character.
        `encoding` - Character encoding for the file.
      Throws:
        `java.io.IOException` - If output file has error.
        `java.io.FileNotFoundException`

    - #### saveMap

          public static void saveMap(java.util.Map<?,?> map,
                     java.lang.String mapFileName,
                     java.lang.String separator,
                     java.lang.String qualifier,
                     java.lang.String encoding)
                              throws java.io.IOException,
                                     java.io.FileNotFoundException

      Save map to a file name.
      Parameters:
        `map` - Map to save.
        `mapFileName` - Output file name.
        `separator` - Field separator.
        `qualifier` - Quote character.
        `encoding` - Character encoding for the file.
      Throws:
        `java.io.IOException` - If output file has error.
        `java.io.FileNotFoundException`

    - #### saveMap

          public static void saveMap(java.util.Map<?,?> map,
                     java.lang.String mapFileName)
                              throws java.io.IOException,
                                     java.io.FileNotFoundException

      Save map to a file name.
      Parameters:
        `map` - Map to save.
        `mapFileName` - Output file name.
      Throws:
        `java.io.IOException` - If output file has error.

        The map is saved with utf-8 encoding and a tab character separating the value from the key.

        `java.io.FileNotFoundException`

    - #### saveSortedMap

          public static void saveSortedMap(java.util.Map<?,?> map,
                           java.io.File mapFile,
                           java.lang.String separator,
                           java.lang.String qualifier,
                           java.lang.String encoding)
                                    throws java.io.IOException,
                                           java.io.FileNotFoundException

      Save map to a file in sorted key order.
      Parameters:
        `map` - Map to save.
        `mapFile` - Output file name.
        `separator` - Field separator.
        `qualifier` - Quote character.
        `encoding` - Character encoding for the file.
      Throws:
        `java.io.IOException` - If output file has error.
        `java.io.FileNotFoundException`

    - #### saveSortedMap

          public static void saveSortedMap(java.util.Map<?,?> map,
                           java.lang.String mapFileName,
                           java.lang.String separator,
                           java.lang.String qualifier,
                           java.lang.String encoding)
                                    throws java.io.IOException,
                                           java.io.FileNotFoundException

      Save map to a file name in sorted key order.
      Parameters:
        `map` - Map to save.
        `mapFileName` - Output file name.
        `separator` - Field separator.
        `qualifier` - Quote character.
        `encoding` - Character encoding for the file.
      Throws:
        `java.io.IOException` - If output file has error.
        `java.io.FileNotFoundException`