cdac.medinfo.sdk.hl7282.utils

## Interface IMultiValuedPairedCollection<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:
    MultiValuedPairedCollection

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

  This interface is a parameterized interface which specifies the contract for the MultiValuedPairedCollection. 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
    `ISingleCollection<T2>` | `get(T1 objT1)` Return the object of type specified at the time of instantiation of this library.
    `ISingleCollection<T2>` | `getAllValues()` Retrieves All values present in the collection
    `void` | `put(T1 objT1, ISingleCollection<T2> objT2)` Added key and collection of values repsective to that key in the paired collection
    `void` | `put(T1 objT1, T2 objT2)` Added key and value in the paired collection
    `void` | `remove(T1 objT1)` Implementation of this method provides a mechanism to remove a key value pair from collection
    `void` | `remove(T1 objT1, T2 objT2)` Implementation of this method provides a mechanism to remove a specified value present for specified key and removes key to if no values present for that key.

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

      `iterator`

- - ### Method Detail

    - #### get

          ISingleCollection<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 MultiValuedPairedCollection
      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 MultiValuedPairedCollection
        `objT2` - object specifying the value corresponding to the key in the specified collection

    - #### put

          void put(T1 objT1,
                 ISingleCollection<T2> objT2)

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

    - #### remove

          void remove(T1 objT1)

      Implementation of this method provides a mechanism to remove a key value pair from collection
      Parameters:
        `objT1` - This parameter specifies the key whose corresponding value to remove

    - #### remove

          void remove(T1 objT1,
                    T2 objT2)

      Implementation of this method provides a mechanism to remove a specified value present for specified key and removes key to if no values present for that key.
      Parameters:
        `objT1` - This parameter specifies the key whose corresponding value to remove
        `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:
        boolean - true if key is present

    - #### getAllValues

          ISingleCollection<T2> getAllValues()

      Retrieves All values present in the collection
      Returns:
        ISingleCollection list of T2 type values