com.ihr.xbrl.comparator
Class ComparatorMapping<T>

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<T,T>
          extended by 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
ComparatorMapping()
           
 
Method Summary
 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 -
correspondent -

delPair

public void delPair(T key,
                    T correspondent)
Removes a pair of elements

Parameters:
key -
correspondent -

getPairOf

public T getPairOf(T key)
Obtains the correspondent element to an initial element

Parameters:
key -
Returns:
the correspondent object of type T

getReversePairOf

public T getReversePairOf(T correspondent)
Obtains the key element for a correspondent element

Parameters:
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


Copyright 2006-2009 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa