| java.lang.Object org.incava.util.diff.Difference
Difference | public class Difference (Code) | | Represents a difference, as used in 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.
|
Field Summary | |
final public static int | NONE |
Constructor Summary | |
public | Difference(int delStart, int delEnd, int addStart, int addEnd) Creates the difference for the given start and end points for the
deletion and addition. |
Method Summary | |
public boolean | equals(Object obj) Compares this object to the other for equality. | public int | getAddedEnd() The point at which the addition ends, if any. | public int | getAddedStart() The point at which the addition starts, if any. | public int | getDeletedEnd() The point at which the deletion ends, if any. | public int | getDeletedStart() The point at which the deletion starts, if any. | public void | setAdded(int line) Sets the point as added. | public void | setDeleted(int line) Sets the point as deleted. | public String | toString() Returns a string representation of this difference. |
NONE | final public static int NONE(Code) | | |
Difference | public Difference(int delStart, int delEnd, int addStart, int addEnd)(Code) | | Creates the difference for the given start and end points for the
deletion and addition.
|
equals | public boolean equals(Object obj)(Code) | | Compares this object to the other for equality. Both objects must be of
type Difference, with the same starting and ending points.
|
getAddedEnd | public int getAddedEnd()(Code) | | The point at which the addition ends, if any. A value equal to
NONE means this must be an addition.
|
getAddedStart | public int getAddedStart()(Code) | | The point at which the addition starts, if any. A value equal to
NONE means this must be an addition.
|
getDeletedEnd | public int getDeletedEnd()(Code) | | The point at which the deletion ends, if any. A value equal to
NONE means this is an addition.
|
getDeletedStart | public int getDeletedStart()(Code) | | The point at which the deletion starts, if any. A value equal to
NONE means this is an addition.
|
setAdded | public void setAdded(int line)(Code) | | Sets the point as added. The start and end points will be modified to
include the given line.
|
setDeleted | public void setDeleted(int line)(Code) | | Sets the point as deleted. The start and end points will be modified to
include the given line.
|
toString | public String toString()(Code) | | Returns a string representation of this difference.
|
|
|