com.ihr.xbrl.comparator

## Class ComparatorMapping<T>

- java.lang.Object
- - java.util.Dictionary<K,V>
  - - java.util.Hashtable<T,T>
    - - com.ihr.xbrl.comparator.ComparatorMapping<T>

- Type Parameters:
    `T` - The element type class
  All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<T,T>

      public class ComparatorMapping<T>
      extends java.util.Hashtable<T,T>

  Template class to store a pair of elements. The pair contains two objects. The key object and the correspondent object.
  Author:
    Ignacio
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ComparatorMapping()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPair(T key, T correspondent)` Adds a pair of elements to the comparatorMapping.
    `void` | `delPair(T key, T correspondent)` Removes a pair of elements.
    `void` | `generateNode(org.jdom.Element parent, java.lang.String rootOfPair, java.lang.String nodeFrom, java.lang.String nodeTo, java.net.URI base)` Generates an XML representation of the mapping object.
    `T` | `getPairOf(T key)` Obtains the correspondent element to an initial element.
    `T` | `getReversePairOf(T correspondent)` Obtains the key element for a correspondent element.

    - ### Methods inherited from class java.util.Hashtable

      `clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ComparatorMapping

          public ComparatorMapping()

  - ### Method Detail

    - #### addPair

          public void addPair(T key,
                     T correspondent)

      Adds a pair of elements to the comparatorMapping.
      Parameters:
        `key` - the key
        `correspondent` - the correspondent

    - #### delPair

          public void delPair(T key,
                     T correspondent)

      Removes a pair of elements.
      Parameters:
        `key` - the key
        `correspondent` - the correspondent

    - #### getPairOf

          public T getPairOf(T key)

      Obtains the correspondent element to an initial element.
      Parameters:
        `key` - the key
      Returns:
        the correspondent object of type T

    - #### getReversePairOf

          public T getReversePairOf(T correspondent)

      Obtains the key element for a correspondent element.
      Parameters:
        `correspondent` - the correspondent
      Returns:
        the key object of type T

    - #### generateNode

          public void generateNode(org.jdom.Element parent,
                          java.lang.String rootOfPair,
                          java.lang.String nodeFrom,
                          java.lang.String nodeTo,
                          java.net.URI base)

      Generates an XML representation of the mapping object. This class is parameterized to work for several types of mappings. Only distinct objects are serialized.
      Parameters:
        `parent` - Element
        `rootOfPair` - String
        `nodeFrom` - String
        `nodeTo` - String
        `base` - URI