cdac.medinfo.sdk.hl7282.utils

## Class MultiValuedPairedCollection<T1,T2>

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

- Type Parameters:
    `T1` - object object specifying key at the time of instantiation of this interface
    `T2` - object object specifying value at the time of instantiation of this interface
  All Implemented Interfaces:
    ICollectionIterable<T2>, IMultiValuedPairedCollection<T1,T2>, java.lang.Iterable<T2>

      public class MultiValuedPairedCollection<T1,T2>
      extends java.lang.Object
      implements IMultiValuedPairedCollection<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` | `MultiValuedPairedCollection.CollectionIterator` This inner class works as an Iterator which helps iterating over the map contained in Message or Group This iterator enables you to traverse through a collection This class is implemented such that the programmer can have any object stored in it he/she wants and having ITag as its key.
    `class` | `MultiValuedPairedCollection.SortedIterator` This inner class works as an Sorted Iterator which helps iterating over the map contained in Message or Group This iterator can be used for the purpose of getting all the elements of the DataSet one by one as it iterates elements in Sorted order.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiValuedPairedCollection()` Constructs a new MultiValuedPairedCollection with the same mappings as the specified Collection.

  - ### 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
    `ISingleCollection<T2>` | `get(T1 objT1)` Provides key based accessing over the internal collection
    `ISingleCollection<T2>` | `getAllValues()` Retrieves All values present in the collection
    `ICollectionIterator<T2>` | `iterator()` Returns an iterator over the internal collection.
    `void` | `put(T1 objT1, ISingleCollection<T2> objT2)` Provides a mechanism for adding a key value pair to the collection
    `void` | `put(T1 objT1, T2 objT2)` Provides a mechanism for adding a key value pair to the collection
    `void` | `remove(T1 objT1)` Provides a mechanism for removing a key value pair to the collection
    `void` | `remove(T1 objT1, T2 objT2)` Provides a removes a specified value present for specified key and removes key too if no values present for that key.
    `int` | `size()` Returns the size of the collection
    `ICollectionIterator<T2>` | `sortedIterator()` Returns an iterator over the internal collection.

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

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

- - ### Constructor Detail

    - #### MultiValuedPairedCollection

          public MultiValuedPairedCollection()

      Constructs a new MultiValuedPairedCollection with the same mappings as the specified Collection.

  - ### 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:
        iterator - returns the iterator over the internal collection.

    - #### sortedIterator

          public ICollectionIterator<T2> sortedIterator()

      Returns an iterator over the internal collection.
      Returns:
        ICollectionIterator<T2> - returns the iterator over the internal collection.

    - #### get

          public ISingleCollection<T2> get(T1 objT1)

      Provides key based accessing over the internal collection
      Specified by:
        `get` in interface `IMultiValuedPairedCollection<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

    - #### getAllValues

          public ISingleCollection<T2> getAllValues()

      Retrieves All values present in the collection
      Specified by:
        `getAllValues` in interface `IMultiValuedPairedCollection<T1,T2>`
      Returns:
        ISingleCollection list of T2 type values

    - #### 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 `IMultiValuedPairedCollection<T1,T2>`
      Parameters:
        `objT1` - This parameter specifies the key.
        `objT2` - This parameter specifies the value.

    - #### remove

          public void remove(T1 objT1)

      Provides a mechanism for removing a key value pair to the collection
      Specified by:
        `remove` in interface `IMultiValuedPairedCollection<T1,T2>`
      Parameters:
        `objT1` - This parameter specifies the key whose corresponding value to remove

    - #### remove

          public void remove(T1 objT1,
                    T2 objT2)

      Provides a removes a specified value present for specified key and removes key too if no values present for that key.
      Specified by:
        `remove` in interface `IMultiValuedPairedCollection<T1,T2>`
      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

    - #### put

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

      Provides a mechanism for adding a key value pair to the collection
      Specified by:
        `put` in interface `IMultiValuedPairedCollection<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 `IMultiValuedPairedCollection<T1,T2>`
      Parameters:
        `objT1` - element whose presence in this collection is to be tested
      Returns:
        boolean - returns the status indicating whether the key is present in the collection or not

    - #### size

          public int size()

      Returns the size of the collection
      Returns:
        int - returns the size of the collection