Skip navigation links

Class SimpleDiff

    • Constructor Detail

      • SimpleDiff

        public SimpleDiff()
    • Method Detail

      • scan

        protected int scan(int[] ndx,
                           int i,
                           int target)
      • diff

        public Revision diff(Object[] orig,
                             Object[] rev)
                      throws DifferentiationFailedException
        Compute the difference between original and revised sequences.
        Specified by:
        diff in interface DiffAlgorithm
        orig - The original sequence.
        rev - The revised sequence to be compared with the original.
        A Revision object describing the differences.
        DifferenciationFailedException - if the diff could not be computed.
        DifferentiationFailedException - if the diff could not be computed.
      • buildEqSet

        protected Map buildEqSet(Object[] orig,
                                 Object[] rev)
        create a Map from each common item in orig and rev to the index of its first occurrence in orig
        orig - the original sequence of items
        rev - the revised sequence of items
      • buildIndex

        protected int[] buildIndex(Map eqs,
                                   Object[] seq,
                                   int NF)
        build a an array such each a[i] = eqs([i]) or NF if eqs([i]) undefined
        eqs - a mapping from Object to Integer
        seq - a sequence of objects
        NF - the not found marker

Copyright © 2003–2019 The Sakai Foundation. All rights reserved.