cdac.medinfo.sdk.hl7282.utils

## Interface IPairedCollection<T1,T2>

- Type Parameters:
    `T1` - - object to be used as a key in PairedCollection
    `T2` - - object to be used as a value in PairedCollection
  All Superinterfaces:
    ICollectionIterable<T2>, java.lang.Iterable<T2>
  All Known Implementing Classes:
    PairedCollection

      public interface IPairedCollection<T1,T2>
      extends ICollectionIterable<T2>

  This interface is a parameterized interface which specifies the contract for the PairedCollection. This template is generic so that any key value pairs can be used. The only condition for the object to be used as a key is to override hashCode() method to provide value based hashCode generation so that all the objects containing same values should generate same hashCode.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `contains(T1 objT1)` Check whether the specified key is present in the collection
    `T2` | `get(T1 objT1)` Return the object of type specified at the time of instantiation of this library.
    `java.lang.Object[]` | `getKeys()` The implementation of this method gets all the keys in the collection.
    `void` | `put(T1 objT1, T2 objT2)` Added key and value in the paired collection
    `T2` | `remove(T1 objT1)` The implementation of this method removes the values associated with the given key.
    `int` | `size()` The implementation of this method retrieves the size of the collection.

    - ### Methods inherited from interface cdac.medinfo.sdk.hl7282.commoninterface.ICollectionIterable

      `iterator`

- - ### Method Detail

    - #### get

          T2 get(T1 objT1)

      Return the object of type specified at the time of instantiation of this library.
      Parameters:
        `objT1` - object specifying the key of PairedCollection
      Returns:
        objT2 - object specifying the value corresponding to the key in the specified collection

    - #### put

          void put(T1 objT1,
                 T2 objT2)

      Added key and value in the paired collection
      Parameters:
        `objT1` - object specifying the key of PairedCollection
        `objT2` - object specifying the value corresponding to the key in the specified collection

    - #### contains

          boolean contains(T1 objT1)

      Check whether the specified key is present in the collection
      Parameters:
        `objT1` - object specifying the key of PairedCollection
      Returns:
        true if key is present

    - #### remove

          T2 remove(T1 objT1)

      The implementation of this method removes the values associated with the given key.
      Parameters:
        `objT1` - key whose mapping value is removed.
      Returns:
        - previous value associated with the key or null if no mapping for this key is found.

    - #### size

          int size()

      The implementation of this method retrieves the size of the collection.
      Returns:
        size - returns the number of elements present in the collection

    - #### getKeys

          java.lang.Object[] getKeys()

      The implementation of this method gets all the keys in the collection.
      Returns:
        Object[] - array of keys in the collection.