org.crosswire.common.diff

## Class DiffCleanup

- java.lang.Object
- - org.crosswire.common.diff.DiffCleanup

-     public final class DiffCleanup
      extends Object

  Various Strategies to cleanup a diff list. Based on the LGPL Diff_Match_Patch v1.5 javascript of Neil Fraser, Copyright (C) 2006
  http://neil.fraser.name/software/diff_match_patch/
  Author:
    DM Smith
  See Also:
    `The GNU Lesser General Public License for details.`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static int` | `EDIT_COST` Cost of an empty edit operation in terms of edit characters.
    `private static int` | `editCost`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `private` | `DiffCleanup()` Utility class constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `cleanupEfficiency(List<Difference> diffs)` Reduce the number of edits by eliminating operationally trivial equalities.
    `static void` | `cleanupMerge(List<Difference> diffs)` Reorder and merge like edit sections.
    `static void` | `cleanupSemantic(List<Difference> diffs)` Reduce the number of edits by eliminating semantically trivial equalities.
    `static void` | `setEditCost(int newEditCost)` Set the edit cost for efficiency

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

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

- - ### Field Detail

    - #### EDIT_COST

          private static final int EDIT_COST

      Cost of an empty edit operation in terms of edit characters.
      See Also:
        Constant Field Values

    - #### editCost

          private static int editCost

  - ### Constructor Detail

    - #### DiffCleanup

          private DiffCleanup()

      Utility class constructor.

  - ### Method Detail

    - #### cleanupSemantic

          public static void cleanupSemantic(List<Difference> diffs)

      Reduce the number of edits by eliminating semantically trivial equalities.
      Parameters:
        `diffs` - List of Difference objects

    - #### cleanupEfficiency

          public static void cleanupEfficiency(List<Difference> diffs)

      Reduce the number of edits by eliminating operationally trivial equalities.
      Parameters:
        `diffs` - List of Difference objects

    - #### cleanupMerge

          public static void cleanupMerge(List<Difference> diffs)

      Reorder and merge like edit sections. Merge equalities. Any edit section can move as long as it doesn't cross an equality.
      Parameters:
        `diffs` - List of Difference objects

    - #### setEditCost

          public static void setEditCost(int newEditCost)

      Set the edit cost for efficiency
      Parameters:
        `newEditCost` - the edit cost