com.ihr.xbrl.comparator

## Class DTSComparator

- java.lang.Object
- - com.ihr.xbrl.comparator.DTSComparator

-     public class DTSComparator
      extends java.lang.Object

  Compares two DTSs according to the rules of the XVS document.
  Author:
    Ignacio

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DTSComparator()` Instantiates a new DTS comparator.
    `DTSComparator(DTSContainer dts1, DTSContainer dts2)` Instantiates a new DTS comparator.
    `DTSComparator(DTSContainer dts1, DTSContainer dts2, ComparatorMapping<java.lang.String> namespaceMap, ComparatorMapping<XMLElementDefinition> conceptMap, ComparatorMapping<java.lang.String> roleMap, ComparatorMapping<XBRLResource> resourceMap)` A DTS Comparator investigates the differences between two DTSs.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `compare()` Compare.
    `ComparatorMapping<XMLElementDefinition>` | `getConceptMapper()` Gets the concept mapper.
    `java.util.Iterator<Event>` | `getEvents()` Gets the events.
    `DTSContainer` | `getFromDTS()` Gets the from dts.
    `ComparatorMapping<java.lang.String>` | `getNamespaceMapper()` Gets the namespace mapper.
    `ComparatorMapping<XBRLResource>` | `getResourceMapper()` Gets the resource mapper.
    `ComparatorMapping<java.lang.String>` | `getRoleMapper()` Gets the role mapper.
    `DTSContainer` | `getToDTS()` Gets the to dts.
    `ComparatorMapping<XMLElementDefinition>` | `guessConceptMapTable(OrderedFragmentsList items1, OrderedFragmentsList items2)` Builds up a new conceptMap table based on the probability of concept matching because of the concept QNames after namespace rules apply.
    `ComparatorMapping<XBRLResource>` | `guessResourceMapTable(OrderedFragmentsList items1, OrderedFragmentsList items2)` Builds up a new resourceMap table based on the probability of resources to match because of the resources properties
    `void` | `setConceptMapper(ComparatorMapping<XMLElementDefinition> newConceptMapper)` Sets the concept mapper.
    `void` | `setFromDTS(DTSContainer leftDTS)` Sets the from dts.
    `void` | `setNamespaceMapper(ComparatorMapping<java.lang.String> newNamespaceMapper)` Sets the namespace mapper.
    `void` | `setResourceMapper(ComparatorMapping<XBRLResource> newMap)` Sets the resource mapper.
    `void` | `setRoleMapper(ComparatorMapping<java.lang.String> newRoleMapper)` Sets the role mapper.
    `void` | `setToDTS(DTSContainer rightDTS)` Sets the to dts.

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

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

- - ### Constructor Detail

    - #### DTSComparator

          public DTSComparator()
                        throws com.rs.lic.LicenseVerificationException

      Instantiates a new DTS comparator.
      Throws:
        `com.rs.lic.LicenseVerificationException` - the license verification exception

    - #### DTSComparator

          public DTSComparator(DTSContainer dts1,
                       DTSContainer dts2)

      Instantiates a new DTS comparator.
      Parameters:
        `dts1` - the dts1
        `dts2` - the dts2

    - #### DTSComparator

          public DTSComparator(DTSContainer dts1,
                       DTSContainer dts2,
                       ComparatorMapping<java.lang.String> namespaceMap,
                       ComparatorMapping<XMLElementDefinition> conceptMap,
                       ComparatorMapping<java.lang.String> roleMap,
                       ComparatorMapping<XBRLResource> resourceMap)

      A DTS Comparator investigates the differences between two DTSs.
      Parameters:
        `dts1` - the dts1
        `dts2` - the dts2
        `namespaceMap` - the namespace map
        `conceptMap` - the concept map
        `roleMap` - the role map
        `resourceMap` - the resource map

  - ### Method Detail

    - #### compare

          public void compare()

      Compare.

    - #### getNamespaceMapper

          public ComparatorMapping<java.lang.String> getNamespaceMapper()

      Gets the namespace mapper.
      Returns:
        the namespace mapper

    - #### getRoleMapper

          public ComparatorMapping<java.lang.String> getRoleMapper()

      Gets the role mapper.
      Returns:
        the role mapper

    - #### getConceptMapper

          public ComparatorMapping<XMLElementDefinition> getConceptMapper()

      Gets the concept mapper.
      Returns:
        the concept mapper

    - #### getResourceMapper

          public ComparatorMapping<XBRLResource> getResourceMapper()

      Gets the resource mapper.
      Returns:
        the resource mapper

    - #### setFromDTS

          public void setFromDTS(DTSContainer leftDTS)

      Sets the from dts.
      Parameters:
        `leftDTS` - the new from dts

    - #### setToDTS

          public void setToDTS(DTSContainer rightDTS)

      Sets the to dts.
      Parameters:
        `rightDTS` - the new to dts

    - #### guessConceptMapTable

          public ComparatorMapping<XMLElementDefinition> guessConceptMapTable(OrderedFragmentsList items1,
                                                                     OrderedFragmentsList items2)

      Builds up a new conceptMap table based on the probability of concept matching because of the concept QNames after namespace rules apply.
      Parameters:
        `items1` - OrderedFragmentList of XMLElementDefinition elements only
        `items2` - OrderedFragmentList of XMLElementDefinition elements only
      Returns:
        the comparator mapping

    - #### guessResourceMapTable

          public ComparatorMapping<XBRLResource> guessResourceMapTable(OrderedFragmentsList items1,
                                                              OrderedFragmentsList items2)

      Builds up a new resourceMap table based on the probability of resources to match because of the resources properties
      Parameters:
        `items1` - OrderedFragmentList of XBRLResource elements only
        `items2` - OrderedFragmentList of XBRLResource elements only
      Returns:
        the comparator mapping

    - #### getEvents

          public java.util.Iterator<Event> getEvents()

      Gets the events.
      Returns:
        the events

    - #### getFromDTS

          public DTSContainer getFromDTS()

      Gets the from dts.
      Returns:
        DTSContainer

    - #### getToDTS

          public DTSContainer getToDTS()

      Gets the to dts.
      Returns:
        DTSContainer

    - #### setRoleMapper

          public void setRoleMapper(ComparatorMapping<java.lang.String> newRoleMapper)

      Sets the role mapper.
      Parameters:
        `newRoleMapper` - the new role mapper

    - #### setNamespaceMapper

          public void setNamespaceMapper(ComparatorMapping<java.lang.String> newNamespaceMapper)

      Sets the namespace mapper.
      Parameters:
        `newNamespaceMapper` - the new namespace mapper

    - #### setConceptMapper

          public void setConceptMapper(ComparatorMapping<XMLElementDefinition> newConceptMapper)

      Sets the concept mapper.
      Parameters:
        `newConceptMapper` - the new concept mapper

    - #### setResourceMapper

          public void setResourceMapper(ComparatorMapping<XBRLResource> newMap)

      Sets the resource mapper.
      Parameters:
        `newMap` - the new resource mapper