Top Inners Fields Constructors Methods
com.github.difflib.algorithm.myers

public Class MyersDiffWithLinearSpace<T>

extends Object
implements DiffAlgorithmI<T>
Class Inheritance
All Implemented Interfaces
com.github.difflib.algorithm.DiffAlgorithmI
Imports
com.github.difflib.algorithm.Change, .DiffAlgorithmFactory, .DiffAlgorithmI, .DiffAlgorithmListener, com.github.difflib.patch.DeltaType, java.util.ArrayList, .List, .Objects, java.util.function.BiPredicate, .Consumer

Author
tw

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private final BiPredicate<T, T>

Constructor Summary

AccessConstructor and Description
public
public
MyersDiffWithLinearSpace(final BiPredicate<T, T> equalizer)

Method Summary

Modifier and TypeMethod and Description
private void
buildScript(MyersDiffWithLinearSpace<T>.DiffData data, int start1, int end1, int start2, int end2, Consumer<Integer> progress)

private MyersDiffWithLinearSpace<T>.Snake
buildSnake(MyersDiffWithLinearSpace<T>.DiffData data, final int start, final int diag, final int end1, final int end2)

public List<Change>
computeDiff(List<T> source, List<T> target, DiffAlgorithmListener progress)

Implements com.github.difflib.algorithm.DiffAlgorithmI.computeDiff.

Computes the changeset to patch the source list to the target list.

public static DiffAlgorithmFactory
factory()

Factory to create instances of this specific diff algorithm.

private MyersDiffWithLinearSpace<T>.Snake
getMiddleSnake(MyersDiffWithLinearSpace<T>.DiffData data, int start1, int end1, int start2, int end2)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

equalizerback to summary
private final BiPredicate<T, T> equalizer

Constructor Detail

MyersDiffWithLinearSpaceback to summary
public MyersDiffWithLinearSpace()
MyersDiffWithLinearSpaceback to summary
public MyersDiffWithLinearSpace(final BiPredicate<T, T> equalizer)

Method Detail

buildScriptback to summary
private void buildScript(MyersDiffWithLinearSpace<T>.DiffData data, int start1, int end1, int start2, int end2, Consumer<Integer> progress)
buildSnakeback to summary
private MyersDiffWithLinearSpace<T>.Snake buildSnake(MyersDiffWithLinearSpace<T>.DiffData data, final int start, final int diag, final int end1, final int end2)
computeDiffback to summary
public List<Change> computeDiff(List<T> source, List<T> target, DiffAlgorithmListener progress)

Implements com.github.difflib.algorithm.DiffAlgorithmI.computeDiff.

Doc from com.github.difflib.algorithm.DiffAlgorithmI.computeDiff.

Computes the changeset to patch the source list to the target list.

Annotations
@Override
factoryback to summary
public static DiffAlgorithmFactory factory()

Factory to create instances of this specific diff algorithm.

getMiddleSnakeback to summary
private MyersDiffWithLinearSpace<T>.Snake getMiddleSnake(MyersDiffWithLinearSpace<T>.DiffData data, int start1, int end1, int start2, int end2)
com.github.difflib.algorithm.myers back to summary

private Class MyersDiffWithLinearSpace.DiffData

extends Object
Class Inheritance
  • java.lang.Object
  • com.github.difflib.algorithm.myers.MyersDiffWithLinearSpace.DiffData

Field Summary

Modifier and TypeField and Description
pack-priv final List<Change>
pack-priv final int
pack-priv final List<T>
pack-priv final List<T>
pack-priv final int[]
pack-priv final int[]

Constructor Summary

AccessConstructor and Description
public
DiffData(List<T> source, List<T> target)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

scriptback to summary
pack-priv final List<Change> script
sizeback to summary
pack-priv final int size
sourceback to summary
pack-priv final List<T> source
targetback to summary
pack-priv final List<T> target
vDownback to summary
pack-priv final int[] vDown
vUpback to summary
pack-priv final int[] vUp

Constructor Detail

DiffDataback to summary
public DiffData(List<T> source, List<T> target)
com.github.difflib.algorithm.myers back to summary

private Class MyersDiffWithLinearSpace.Snake

extends Object
Class Inheritance
  • java.lang.Object
  • com.github.difflib.algorithm.myers.MyersDiffWithLinearSpace.Snake

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final int
pack-priv final int

Constructor Summary

AccessConstructor and Description
public
Snake(final int start, final int end, final int diag)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

diagback to summary
pack-priv final int diag
endback to summary
pack-priv final int end
startback to summary
pack-priv final int start

Constructor Detail

Snakeback to summary
public Snake(final int start, final int end, final int diag)