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 java.lang.Integer |
NONE |
| Constructor and Description |
|---|
Difference(java.lang.Integer delStart,
java.lang.Integer delEnd,
java.lang.Integer addStart,
java.lang.Integer 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.
|
java.lang.Integer |
getAddedEnd()
The point at which the addition ends, if any.
|
java.lang.Integer |
getAddedStart()
The point at which the addition starts, if any.
|
java.lang.Integer |
getDeletedEnd()
The point at which the deletion ends, if any.
|
java.lang.Integer |
getDeletedStart()
The point at which the deletion starts, if any.
|
int |
hashCode() |
boolean |
isAdd() |
boolean |
isChange() |
boolean |
isDelete() |
java.lang.String |
toString()
Returns a string representation of this difference.
|
protected java.lang.String |
toString(int from,
int to) |
java.lang.String |
toStringOrig()
Returns a string representation of this difference.
|
public Difference(java.lang.Integer delStart,
java.lang.Integer delEnd,
java.lang.Integer addStart,
java.lang.Integer addEnd)
public java.lang.Integer getDeletedStart()
NONE means this is an addition.public java.lang.Integer getDeletedEnd()
NONE means this is an addition.public java.lang.Integer getAddedStart()
NONE means this must be a deletion.public java.lang.Integer getAddedEnd()
NONE means this must be a deletion.public boolean isAdd()
public boolean isDelete()
public boolean isChange()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toStringOrig()
protected java.lang.String toString(int from,
int to)
public java.lang.String toString()
toString in class java.lang.Object