File tree 1 file changed +16
-2
lines changed
src/main/java/com/github/difflib/algorithm
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .github .difflib .algorithm ;
17
17
18
+ import java .util .Arrays ;
18
19
import java .util .List ;
19
20
20
21
/**
21
22
* Interface of a diff algorithm.
22
- *
23
+ *
23
24
* @author Tobias Warneke (t.warneke@gmx.net)
24
25
*/
25
26
public interface DiffAlgorithmI <T > {
26
-
27
+
27
28
/**
28
29
* Computes the changeset to patch the source list to the target list.
29
30
*
@@ -34,4 +35,17 @@ public interface DiffAlgorithmI<T> {
34
35
* @throws DiffException
35
36
*/
36
37
List <Change > computeDiff (List <T > source , List <T > target , DiffAlgorithmListener progress ) throws DiffException ;
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
+ default List <Change > computeDiff (T [] source , T [] target , DiffAlgorithmListener progress ) throws DiffException {
49
+ return computeDiff (Arrays .asList (source ), Arrays .asList (target ), progress );
50
+ }
37
51
}
You can’t perform that action at this time.
0 commit comments