com.io7m.jstructural.annotated

## Class SAIDMap

- java.lang.Object
- - com.io7m.jstructural.annotated.SAIDMap

- All Implemented Interfaces:
    SAIDMapReadable, SAIDMapWritable

      public final class SAIDMap
      extends Object
      implements SAIDMapWritable, SAIDMapReadable

  Mappings from IDs to content.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SAIDMap(com.io7m.jlog.Log in_log)` Construct a new empty map.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `SAIDTargetContent` | `get(SAID id)` Retrieve the content associated with the given ID, or `null` if there is no association.
    `void` | `put(SAID id, SAIDTargetContent c)` Associate the given content with the given ID.
    `int` | `size()`

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

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

- - ### Constructor Detail

    - #### SAIDMap

          public SAIDMap(@Nonnull
                 com.io7m.jlog.Log in_log)

      Construct a new empty map.
      Parameters:
        `in_log` - The log handle

  - ### Method Detail

    - #### get

          public SAIDTargetContent get(@Nonnull
                              SAID id)
                                throws com.io7m.jaux.Constraints.ConstraintError

      Description copied from interface: `SAIDMapReadable`
      Retrieve the content associated with the given ID, or `null` if there is no association.
      Specified by:
        `get` in interface `SAIDMapReadable`
      Parameters:
        `id` - The ID
      Returns:
        The associated content
      Throws:
        `com.io7m.jaux.Constraints.ConstraintError` - If any parameter is `null`

    - #### put

          public void put(@Nonnull
                 SAID id,
                 @Nonnull
                 SAIDTargetContent c)
                   throws com.io7m.jaux.Constraints.ConstraintError

      Description copied from interface: `SAIDMapWritable`
      Associate the given content with the given ID.
      Specified by:
        `put` in interface `SAIDMapWritable`
      Parameters:
        `id` - The ID
        `c` - The content
      Throws:
        `com.io7m.jaux.Constraints.ConstraintError` - If any parameter is `null`, or the given ID is already used

    - #### size

          public int size()

      Specified by:
        `size` in interface `SAIDMapReadable`
      Returns:
        The number of mappings

Copyright © 2014. All rights reserved.