Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd506d62

Browse files
committed
added a default method for computeDiff from arrays
1 parent33f2d74 commitd506d62

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

‎src/main/java/com/github/difflib/algorithm/DiffAlgorithmI.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
*/
1616
packagecom.github.difflib.algorithm;
1717

18+
importjava.util.Arrays;
1819
importjava.util.List;
1920

2021
/**
2122
* Interface of a diff algorithm.
22-
*
23+
*
2324
* @author Tobias Warneke (t.warneke@gmx.net)
2425
*/
2526
publicinterfaceDiffAlgorithmI<T> {
26-
27+
2728
/**
2829
* Computes the changeset to patch the source list to the target list.
2930
*
@@ -34,4 +35,17 @@ public interface DiffAlgorithmI<T> {
3435
* @throws DiffException
3536
*/
3637
List<Change>computeDiff(List<T>source,List<T>target,DiffAlgorithmListenerprogress)throwsDiffException;
38+
39+
/**
40+
* Simple extension to compute a changeset using arrays.
41+
*
42+
* @param source
43+
* @param target
44+
* @param progress
45+
* @return
46+
* @throws com.github.difflib.algorithm.DiffException
47+
*/
48+
defaultList<Change>computeDiff(T[]source,T[]target,DiffAlgorithmListenerprogress)throwsDiffException {
49+
returncomputeDiff(Arrays.asList(source),Arrays.asList(target),progress);
50+
}
3751
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp