cdac.medinfo.sdk.hl7282.utils

## Class PairedCollection<T1,T2>

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.utils.PairedCollection<T1,T2>

- Type Parameters:
    `T1` - key with value T2
    `T2` - value for key T1
  All Implemented Interfaces:
    ICollectionIterable<T2>, IPairedCollection<T1,T2>, java.lang.Iterable<T2>

      public class PairedCollection<T1,T2>
      extends java.lang.Object
      implements IPairedCollection<T1,T2>

  This interface provides the user with an abstract interface towards collections holding series of objects.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `PairedCollection.CollectionIterator` This inner class works as an Iterator which helps iterating over the map contained in the DataSet This iterator can be used for the purpose of getting all the elements of the DataSet one by one This class is implemented such that the programmer can have any object stored in it he/she wants and having ITag as its key.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PairedCollection()` Creates Instance of PairedCollection

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `contains(T1 objT1)` Returns the status indicating whether the key is present in the collection or not
    `T2` | `get(T1 objT1)` Provides key based accessing over the internal collection.
    `T1[]` | `getKeys()` The implementation of this method gets all the keys in the collection.
    `ICollectionIterator<T2>` | `iterator()` Returns an iterator over the internal collection
    `void` | `put(T1 objT1, T2 objT2)` Provides a mechanism for adding a key value pair to the collection.
    `T2` | `remove(T1 objT1)` Removes the values associated with the given key.
    `int` | `size()` Returns the size of the collection.

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

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

- - ### Constructor Detail

    - #### PairedCollection

          public PairedCollection()

      Creates Instance of PairedCollection

  - ### Method Detail

    - #### iterator

          public ICollectionIterator<T2> iterator()

      Returns an iterator over the internal collection
      Specified by:
        `iterator` in interface `ICollectionIterable<T2>`
      Specified by:
        `iterator` in interface `java.lang.Iterable<T2>`
      Returns:
        ICollectionIterator<T2> - returns the iterator over the internal collection

    - #### get

          public T2 get(T1 objT1)

      Provides key based accessing over the internal collection.
      Specified by:
        `get` in interface `IPairedCollection<T1,T2>`
      Parameters:
        `objT1` - This parameter specifies the key whose corresponding value is to be retrieved.
      Returns:
        T2 - object of the type value user specifies at the time of instantiation of this interface.

    - #### put

          public void put(T1 objT1,
                 T2 objT2)

      Provides a mechanism for adding a key value pair to the collection.
      Specified by:
        `put` in interface `IPairedCollection<T1,T2>`
      Parameters:
        `objT1` - This parameter specifies the key.
        `objT2` - This parameter specifies the value.

    - #### contains

          public boolean contains(T1 objT1)

      Returns the status indicating whether the key is present in the collection or not
      Specified by:
        `contains` in interface `IPairedCollection<T1,T2>`
      Parameters:
        `objT1` - This parameter specifies the key.
      Returns:
        boolean - returns the status indicating whether the key is present in the collection or not

    - #### remove

          public T2 remove(T1 objT1)

      Removes the values associated with the given key.
      Specified by:
        `remove` in interface `IPairedCollection<T1,T2>`
      Parameters:
        `objT1` - key whose mapping value is removed.
      Returns:
        T2 - previous value associated with the key or null if no mapping for this key is found.

    - #### size

          public int size()

      Returns the size of the collection.
      Specified by:
        `size` in interface `IPairedCollection<T1,T2>`
      Returns:
        size - returns the size of the collection.

    - #### getKeys

          public T1[] getKeys()

      The implementation of this method gets all the keys in the collection.
      Specified by:
        `getKeys` in interface `IPairedCollection<T1,T2>`
      Returns:
        T1[] - array of keys in the collection.