com.jidesoft.diff
Class Conflict
java.lang.Object
com.jidesoft.diff.Difference
com.jidesoft.diff.Conflict
public class Conflict
- extends Difference
Represents a conflict, as used in Merge. A conflict consists of three pairs of starting and ending
points, each pair representing either the "from" or the "to" or the "other" collection passed to Merge.
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. There are two set of delete
starting and ending points. The delete starting point could be -1. If both of the delete starting point are not -1,
it means this difference is a conflict.
|
Constructor Summary |
Conflict(int deletedStart,
int deletedEnd,
int addedStart,
int addedEnd,
int deleted2Start,
int deleted2End)
|
Conflict
public Conflict(int deletedStart,
int deletedEnd,
int addedStart,
int addedEnd,
int deleted2Start,
int deleted2End)
getDeleted2Start
public int getDeleted2Start()
getDeleted2End
public int getDeleted2End()
setDeleted2
public void setDeleted2(int line)
- Sets the point as added. The start and end points will be modified to include the given line.
equals
public boolean equals(Object obj)
- Description copied from class:
Difference
- Compares this object to the other for equality. Both objects must be of type Difference, with the same starting
and ending points.
- Overrides:
equals in class Difference
toString
public String toString()
- Returns a string representation of this difference.
- Overrides:
toString in class Difference
isConflicted
public boolean isConflicted()
isConflicted
public static boolean isConflicted(List<Conflict> conflicts)
- Checks if the list of Conflicts has any conflicting changes.
- Parameters:
conflicts - the list of Conflicts.
- Returns:
- true or false.