edu.northwestern.at.utils

## Class SetUtils

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

-     public class SetUtils
      extends java.lang.Object

  Set utilities.

- - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> void` | `addAll(java.util.Set<T> set, T[] t)` Add array entries to a set.
    `static java.util.Set<java.lang.String>` | `loadIntoSet(java.util.Set<java.lang.String> set, java.net.URL setURL, java.lang.String encoding)` Load string set from a URL.
    `static java.util.Set<java.lang.String>` | `loadSet(java.io.File setFile, java.lang.String encoding)` Load string set from a file.
    `static java.util.Set<java.lang.String>` | `loadSet(java.lang.String setFileName, java.lang.String encoding)` Load string set from a file name.
    `static java.util.Set<java.lang.String>` | `loadSet(java.net.URL setURL, java.lang.String encoding)` Load string set from a URL.
    `static java.util.Set<java.lang.String>` | `loadSortedSet(java.io.File setFile, java.lang.String encoding)` Load sorted string set from a file.
    `static java.util.Set<java.lang.String>` | `loadSortedSet(java.lang.String setFileName, java.lang.String encoding)` Load sorted string set from a file name.
    `static java.util.Set<java.lang.String>` | `loadSortedSet(java.net.URL setURL, java.lang.String encoding)` Load sorted string set from a URL.
    `static void` | `saveSet(java.util.Set<?> set, java.io.File setFile, java.lang.String encoding)` Save set to a file.
    `static void` | `saveSet(java.util.Set<?> set, java.lang.String setFileName, java.lang.String encoding)` Save set as string to a file name.
    `static void` | `saveSortedSet(java.util.Set<?> set, java.io.File setFile, java.lang.String encoding)` Save sorted set to a file.
    `static void` | `saveSortedSet(java.util.Set<?> set, java.lang.String setFileName, java.lang.String encoding)` Save sorted set to a file name.

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

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

- - ### Constructor Detail

    - #### SetUtils

          protected SetUtils()

      Don't allow instantiation, do allow overrides.

  - ### Method Detail

    - #### loadIntoSet

          public static java.util.Set<java.lang.String> loadIntoSet(java.util.Set<java.lang.String> set,
                                                    java.net.URL setURL,
                                                    java.lang.String encoding)
                                                             throws java.io.IOException,
                                                                    java.io.FileNotFoundException

      Load string set from a URL.
      Parameters:
        `set` - Set into which to read data from URL.
        `setURL` - URL for set file.
        `encoding` - Character encoding for the file.
      Returns:
        Set with values read from URL.
      Throws:
        `java.io.FileNotFoundException` - If input URL does not exist.
        `java.io.IOException` - If input URL cannot be opened.

    - #### loadSet

          public static java.util.Set<java.lang.String> loadSet(java.net.URL setURL,
                                                java.lang.String encoding)
                                                         throws java.io.IOException,
                                                                java.io.FileNotFoundException

      Load string set from a URL.
      Parameters:
        `setURL` - URL for set file.
        `encoding` - Character encoding for the file.
      Returns:
        Set with values read from URL.
      Throws:
        `java.io.FileNotFoundException` - If input file does not exist.
        `java.io.IOException` - If input file cannot be opened.

    - #### loadSortedSet

          public static java.util.Set<java.lang.String> loadSortedSet(java.net.URL setURL,
                                                      java.lang.String encoding)
                                                               throws java.io.IOException,
                                                                      java.io.FileNotFoundException

      Load sorted string set from a URL.
      Parameters:
        `setURL` - URL for set file.
        `encoding` - Character encoding for the file.
      Returns:
        Sorted set with values read from URL.
      Throws:
        `java.io.FileNotFoundException` - If input file does not exist.
        `java.io.IOException` - If input file cannot be opened.

    - #### loadSet

          public static java.util.Set<java.lang.String> loadSet(java.io.File setFile,
                                                java.lang.String encoding)
                                                         throws java.io.IOException,
                                                                java.io.FileNotFoundException

      Load string set from a file.
      Parameters:
        `setFile` - File from which to load set.
        `encoding` - Character encoding for the file.
      Returns:
        Set with values read from file.
      Throws:
        `java.io.FileNotFoundException` - If input file does not exist.
        `java.io.IOException` - If input file cannot be opened.

    - #### loadSortedSet

          public static java.util.Set<java.lang.String> loadSortedSet(java.io.File setFile,
                                                      java.lang.String encoding)
                                                               throws java.io.IOException,
                                                                      java.io.FileNotFoundException

      Load sorted string set from a file.
      Parameters:
        `setFile` - File from which to load set.
        `encoding` - Character encoding for the file.
      Returns:
        Sorted set with values read from file.
      Throws:
        `java.io.FileNotFoundException` - If input file does not exist.
        `java.io.IOException` - If input file cannot be opened.

    - #### loadSet

          public static java.util.Set<java.lang.String> loadSet(java.lang.String setFileName,
                                                java.lang.String encoding)
                                                         throws java.io.IOException,
                                                                java.io.FileNotFoundException

      Load string set from a file name.
      Parameters:
        `setFileName` - File name from which to load set.
        `encoding` - Character encoding for the file.
      Returns:
        Set 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.

    - #### loadSortedSet

          public static java.util.Set<java.lang.String> loadSortedSet(java.lang.String setFileName,
                                                      java.lang.String encoding)
                                                               throws java.io.IOException,
                                                                      java.io.FileNotFoundException

      Load sorted string set from a file name.
      Parameters:
        `setFileName` - File name from which to load set.
        `encoding` - Character encoding for the file.
      Returns:
        Sorted set 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.

    - #### saveSet

          public static void saveSet(java.util.Set<?> set,
                     java.io.File setFile,
                     java.lang.String encoding)
                              throws java.io.IOException,
                                     java.io.FileNotFoundException

      Save set to a file.
      Parameters:
        `set` - Set to save.
        `setFile` - Output file name.
        `encoding` - Character encoding for the file.
      Throws:
        `java.io.IOException` - If output file has error.
        `java.io.FileNotFoundException`

    - #### saveSortedSet

          public static void saveSortedSet(java.util.Set<?> set,
                           java.io.File setFile,
                           java.lang.String encoding)
                                    throws java.io.IOException,
                                           java.io.FileNotFoundException

      Save sorted set to a file.
      Parameters:
        `set` - Set to save. The entries are sorted in ascending order for output.
        `setFile` - Output file name.
        `encoding` - Character encoding for the file.
      Throws:
        `java.io.IOException` - If output file has error.
        `java.io.FileNotFoundException`

    - #### saveSet

          public static void saveSet(java.util.Set<?> set,
                     java.lang.String setFileName,
                     java.lang.String encoding)
                              throws java.io.IOException,
                                     java.io.FileNotFoundException

      Save set as string to a file name.
      Parameters:
        `set` - Set to save.
        `setFileName` - Output file name.
        `encoding` - Character encoding for the file.
      Throws:
        `java.io.IOException` - If output file has error.
        `java.io.FileNotFoundException`

    - #### saveSortedSet

          public static void saveSortedSet(java.util.Set<?> set,
                           java.lang.String setFileName,
                           java.lang.String encoding)
                                    throws java.io.IOException,
                                           java.io.FileNotFoundException

      Save sorted set to a file name.
      Parameters:
        `set` - Set to save.
        `setFileName` - Output file name.
        `encoding` - Character encoding for the file.
      Throws:
        `java.io.IOException` - If output file has error.
        `java.io.FileNotFoundException`

    - #### addAll

          public static <T> void addAll(java.util.Set<T> set,
                        T[] t)
                             throws java.io.IOException,
                                    java.io.FileNotFoundException

      Add array entries to a set.
      Parameters:
        `set` - Set to which to add array entries.
        `t` - Array whose entries are to be added.
      Throws:
        `java.io.IOException`
        `java.io.FileNotFoundException`