JIDE 3.5.15

com.jidesoft.diff
Class Conflict

java.lang.Object
  extended by com.jidesoft.diff.Difference
      extended by 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.


Field Summary
 
Fields inherited from class com.jidesoft.diff.Difference
_addedEnd, _addedStart, _conflicting, _deletedEnd, _deletedStart, NONE
 
Constructor Summary
Conflict(int deletedStart, int deletedEnd, int addedStart, int addedEnd, int deleted2Start, int deleted2End)
           
 
Method Summary
 boolean equals(Object obj)
          Compares this object to the other for equality.
 int getDeleted2End()
           
 int getDeleted2Start()
           
 boolean isConflicted()
           
static boolean isConflicted(List<Conflict> conflicts)
          Checks if the list of Conflicts has any conflicting changes.
 void setDeleted2(int line)
          Sets the point as added.
 String toString()
          Returns a string representation of this difference.
 
Methods inherited from class com.jidesoft.diff.Difference
adjustAdded, adjustDeleted, contains, equal, getAddedEnd, getAddedStart, getDeletedEnd, getDeletedStart, setAdded, setDeleted
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Conflict

public Conflict(int deletedStart,
                int deletedEnd,
                int addedStart,
                int addedEnd,
                int deleted2Start,
                int deleted2End)
Method Detail

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.

JIDE 3.5.15