public class Difference
extends java.lang.Object
Diff
. A difference consists
of two pairs of starting and ending points, each pair representing either the
"from" or the "to" collection passed to Diff
. If an ending point
is -1, then the difference was either a deletion or an addition. For example,
if getDeletedEnd()
returns -1, then the difference represents an
addition.Modifier and Type | Field and Description |
---|---|
static int |
NONE |
Constructor and Description |
---|
Difference(int delStart,
int delEnd,
int addStart,
int addEnd)
Creates the difference for the given start and end points for the
deletion and addition.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Compares this object to the other for equality.
|
int |
getAddedEnd()
The point at which the addition ends, if any.
|
int |
getAddedStart()
The point at which the addition starts, if any.
|
int |
getDeletedEnd()
The point at which the deletion ends, if any.
|
int |
getDeletedStart()
The point at which the deletion starts, if any.
|
void |
setAdded(int line)
Sets the point as added.
|
void |
setDeleted(int line)
Sets the point as deleted.
|
java.lang.String |
toString()
Returns a string representation of this difference.
|
public static final int NONE
public Difference(int delStart, int delEnd, int addStart, int addEnd)
public int getDeletedStart()
NONE
means this is an addition.public int getDeletedEnd()
NONE
means this is an addition.public int getAddedStart()
NONE
means this must be an addition.public int getAddedEnd()
NONE
means this must be an addition.public void setDeleted(int line)
public void setAdded(int line)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object