edu.northwestern.at.utils

## Class TaggedStringsSet

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

- All Implemented Interfaces:
    TaggedStrings

      public class TaggedStringsSet
      extends java.lang.Object
      implements TaggedStrings

  Wraps a set as a TaggedStrings object.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `tag` The common tag for all the string values.
    `protected java.util.Set<java.lang.String>` | `wrappedSet` Set being wrapped.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaggedStringsSet(java.util.Set<java.lang.String> set, java.lang.String tag)` Create a tagged strings set.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsString(java.lang.String string)` See if specified string exists.
    `java.util.Set<java.lang.String>` | `getAllStrings()` Get set of all unique string values.
    `java.util.Set<java.lang.String>` | `getAllTags()` Get set of all unique tag values.
    `java.util.Set<java.lang.String>` | `getSet()` Return the wrapped set.
    `int` | `getStringCount()` Get number of strings.
    `java.lang.String` | `getTag(java.lang.String string)` Get the tag value associated with a string.
    `void` | `putTag(java.lang.String string, java.lang.String tag)` Set the tag value associated with a string.

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

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

- - ### Field Detail

    - #### wrappedSet

          protected java.util.Set<java.lang.String> wrappedSet

      Set being wrapped.

    - #### tag

          protected java.lang.String tag

      The common tag for all the string values.

  - ### Constructor Detail

    - #### TaggedStringsSet

          public TaggedStringsSet(java.util.Set<java.lang.String> set,
                          java.lang.String tag)

      Create a tagged strings set.
      Parameters:
        `set` - The set to wrap.
        `tag` - The tag value for all set entries.

  - ### Method Detail

    - #### containsString

          public boolean containsString(java.lang.String string)

      See if specified string exists.
      Specified by:
        `containsString` in interface `TaggedStrings`
      Parameters:
        `string` - The string.
      Returns:
        True if specified string exists.

    - #### getTag

          public java.lang.String getTag(java.lang.String string)

      Get the tag value associated with a string.
      Specified by:
        `getTag` in interface `TaggedStrings`
      Parameters:
        `string` - The string.
      Returns:
        The tag value associated with the string. All strings in the set have the same tag. Returns null if the string is not in the set.

    - #### putTag

          public void putTag(java.lang.String string,
                    java.lang.String tag)

      Set the tag value associated with a string.
      Specified by:
        `putTag` in interface `TaggedStrings`
      Parameters:
        `string` - The string.
        `tag` - The tag.

        Note: the tag value is ignored.

    - #### getStringCount

          public int getStringCount()

      Get number of strings.
      Specified by:
        `getStringCount` in interface `TaggedStrings`
      Returns:
        Number of strings.

    - #### getAllTags

          public java.util.Set<java.lang.String> getAllTags()

      Get set of all unique tag values.
      Specified by:
        `getAllTags` in interface `TaggedStrings`
      Returns:
        Set of all unique tag values.

    - #### getAllStrings

          public java.util.Set<java.lang.String> getAllStrings()

      Get set of all unique string values.
      Specified by:
        `getAllStrings` in interface `TaggedStrings`
      Returns:
        Set of all unique string values.

    - #### getSet

          public java.util.Set<java.lang.String> getSet()

      Return the wrapped set.
      Returns:
        The wrapped set.