File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
src/main/java/com/github/difflib/algorithm Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 1515 */
1616package com .github .difflib .algorithm ;
1717
18+ import java .util .Arrays ;
1819import java .util .List ;
1920
2021/**
2122 * Interface of a diff algorithm.
22- *
23+ *
2324 * @author Tobias Warneke (t.warneke@gmx.net)
2425 */
2526public interface DiffAlgorithmI <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 , 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+ }
3751}
You can’t perform that action at this time.
0 commit comments