Class DiffList<T>

    • Constructor Detail

      • DiffList

        public DiffList()
    • Method Detail

      • computeFirstList

        public List<T> computeFirstList()
        Compute and return the source text (all equalities and deletions).
        Returns:
        Source text.
      • computeSecondList

        public List<T> computeSecondList()
        Compute and return the destination text (all equalities and insertions).
        Returns:
        Destination text.
      • getLevenshteinDistance

        public int getLevenshteinDistance()
        Compute the Levenshtein distance; the number of inserted, deleted or substituted characters.
        Returns:
        Number of changes.
      • translateIndex

        public int translateIndex​(int loc)
        loc is a location in text1, compute and return the equivalent location in text2. e.g. "The cat" vs "The big cat", 1->1, 5->8
        Parameters:
        loc - Location within text1.
        Returns:
        Location within text2.