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

Appearance settings
This repository was archived by the owner on Jun 6, 2021. It is now read-only.

Commit 74f025e

Browse filesBrowse files
author
dm.naumenko@gmail.com
committed
add type information to the interface
git-svn-id: http://java-diff-utils.googlecode.com/svn/trunk@25 d8d7d024-a22d-11de-b755-fd640f38fa9d
1 parent f74a584 commit 74f025e
Copy full SHA for 74f025e

4 files changed

+24Lines changed: 24 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/difflib/ChangeDelta.java‎

Copy file name to clipboardExpand all lines: src/difflib/ChangeDelta.java
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,9 @@ public String toString() {
8484
return "[ChangeDelta, position: " + getOriginal().getPosition() + ", lines: "
8585
+ getOriginal().getLines() + " to " + getRevised().getLines() + "]";
8686
}
87+
88+
@Override
89+
public TYPE getType() {
90+
return Delta.TYPE.CHANGE;
91+
}
8792
}
Collapse file

‎src/difflib/DeleteDelta.java‎

Copy file name to clipboardExpand all lines: src/difflib/DeleteDelta.java
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ public void restore(List<Object> target) {
5858
}
5959
}
6060

61+
@Override
62+
public TYPE getType() {
63+
return Delta.TYPE.DELETE;
64+
}
65+
6166
@Override
6267
public void verify(List<?> target) throws PatchFailedException {
6368
getOriginal().verify(target);
Collapse file

‎src/difflib/Delta.java‎

Copy file name to clipboardExpand all lines: src/difflib/Delta.java
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ public abstract class Delta {
2626
private Chunk original;
2727
private Chunk revised;
2828

29+
public enum TYPE {
30+
CHANGE, DELETE, INSERT
31+
}
32+
2933
/**
3034
* Construct the delta for original and revised chunks
3135
*
@@ -61,6 +65,12 @@ public Delta(Chunk original, Chunk revised) {
6165
*/
6266
public abstract void restore(List<Object> target);
6367

68+
/**
69+
* Returns the type of delta
70+
* @return the type enum
71+
*/
72+
public abstract TYPE getType();
73+
6474
/**
6575
* @return the Chunk describing the original text
6676
*/
Collapse file

‎src/difflib/InsertDelta.java‎

Copy file name to clipboardExpand all lines: src/difflib/InsertDelta.java
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public void verify(List<?> target) throws PatchFailedException {
6666

6767
}
6868

69+
public TYPE getType() {
70+
return Delta.TYPE.INSERT;
71+
}
72+
6973
@Override
7074
public String toString() {
7175
return "[InsertDelta, position: " + getOriginal().getPosition() + ", lines: "

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.