com.sun.tdk.specdiff.assertdiff

## Class DocumentMatcher

- java.lang.Object
- - com.sun.tdk.specdiff.assertdiff.DocumentMatcher

-     public class DocumentMatcher
      extends java.lang.Object

  The class implementing the entire logic on matching assertions. The usage of this class:

           oldDM = new DocumentModel(oldAssertions);
           newDM = new DocumentModel(newAssertions);
           analyzer = createAnalyzer();
           DocumentMatcher dm = new DocumentMatcher();
           dm.match(oldDM, newDM, analyzer);
           for (Pair p: matcher.getIdentical()) {
               // ...
           }
           for (Pair p: matcher.getVerySimilar()) {
               // ...
           }

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DocumentMatcher.Pair` The object to hold two String object.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocumentMatcher()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<java.lang.String>` | `getAdded()`
    `java.util.List<DocumentMatcher.Pair>` | `getChanged()`
    `java.util.List<DocumentMatcher.Pair>` | `getIdentical()`
    `java.util.List<java.lang.String>` | `getRemoved()`
    `java.util.Map<java.lang.String,java.lang.String>` | `getSectionMap()`
    `java.util.List<DocumentMatcher.Pair>` | `getSimilar()`
    `java.util.List<DocumentMatcher.Pair>` | `getVerySimilar()`
    `protected void` | `handleSections(DocumentModel oldDM, DocumentModel newDM)` Initialize section map based on collected section pairs.
    `void` | `match(DocumentModel oldDM, DocumentModel newDM, Analyzer analyzer)` Does all the job on matching assertions between old and new versions of a document.

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

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

- - ### Constructor Detail

    - #### DocumentMatcher

          public DocumentMatcher()

  - ### Method Detail

    - #### match

          public void match(DocumentModel oldDM,
                            DocumentModel newDM,
                            Analyzer analyzer)

      Does all the job on matching assertions between old and new versions of a document. After analysis has completed the result could be retrieved invoking by the following methods: getIdentical(), getChanged(), getVerySimilar(), getRemoved(), getAdded()
      Parameters:
        `oldDM` - older version of a document
        `newDM` - newer version of the document
        `analyzer` - analyzer instance to be used.
      See Also:
        `getIdentical()`, `getChanged()`, `getVerySimilar()`, `getRemoved()`, `getAdded()`

    - #### handleSections

          protected void handleSections(DocumentModel oldDM,
                                        DocumentModel newDM)

      Initialize section map based on collected section pairs.

    - #### getIdentical

          public java.util.List<DocumentMatcher.Pair> getIdentical()

    - #### getVerySimilar

          public java.util.List<DocumentMatcher.Pair> getVerySimilar()

    - #### getSimilar

          public java.util.List<DocumentMatcher.Pair> getSimilar()

    - #### getChanged

          public java.util.List<DocumentMatcher.Pair> getChanged()

    - #### getAdded

          public java.util.List<java.lang.String> getAdded()

    - #### getRemoved

          public java.util.List<java.lang.String> getRemoved()

    - #### getSectionMap

          public java.util.Map<java.lang.String,java.lang.String> getSectionMap()

      Returns:
        map newCtx --> oldCtx