Class MeyersDiff<T>

  • All Implemented Interfaces:
    DiffAlgorithmI<T>

    public final class MeyersDiff<T>
    extends Object
    implements DiffAlgorithmI<T>
    A clean-room implementation of Eugene Meyers greedy differencing algorithm.
    • Constructor Detail

      • MeyersDiff

        public MeyersDiff()
      • MeyersDiff

        public MeyersDiff​(BiPredicate<T,​T> equalizer)
    • Method Detail

      • computeDiff

        public List<Change> computeDiff​(List<T> source,
                                        List<T> target,
                                        DiffAlgorithmListener progress)
        Computes the changeset to patch the source list to the target list. Return empty diff if get the error while procession the difference.
        Specified by:
        computeDiff in interface DiffAlgorithmI<T>
        Parameters:
        source - source data
        target - target data
        progress - progress listener
        Returns:
      • factory

        public static DiffAlgorithmFactory factory()
        Factory to create instances of this specific diff algorithm.