Class RangeDifference
java.lang.Object
org.eclipse.compare.rangedifferencer.RangeDifference
Description of a change between two or three ranges of comparable entities.
 
 RangeDifference objects are the elements of a compare result returned from
 the RangeDifferencer find*  methods.
 Clients use these objects as they are returned from the differencer.
 This class is not intended to be instantiated outside of the Compare framework.
 
 Note: A range in the RangeDifference object is given as a start index
 and length in terms of comparable entities. However, these entity indices and counts
 are not necessarily character positions. For example, if an entity represents a line
 in a document, the start index would be a line number and the count would be in lines.
 
- See Also:
- Restriction:
- This class is not intended to be instantiated by clients.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThree-way change constant indicating the same change in both right and left, that is only the ancestor is different.protected intprotected intstatic final intTwo-way change constant indicating two-way change (same asRIGHT)static final intThree-way change constant indicating a change in both right and left.static final intConstant indicating an unknown change kind.protected intthe kind of change: NOCHANGE, CHANGE, LEFT, RIGHT, ANCESTOR, CONFLICT, ERRORstatic final intThree-way change constant indicating a change in left.protected intprotected intstatic final intTwo-way change constant indicating no change.static final intThree-way change constant indicating a change in right.protected intprotected int
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedRangeDifference(int changeKind) Creates a new range difference with the given change kind.protectedRangeDifference(int kind, int rightStart, int rightLength, int leftStart, int leftLength) Creates a newRangeDifferencewith the given change kind and left and right ranges.protectedRangeDifference(int kind, int rightStart, int rightLength, int leftStart, int leftLength, int ancestorStart, int ancestorLength) Creates a newRangeDifferencewith the given change kind and left, right, and ancestor ranges.
- 
Method SummaryModifier and TypeMethodDescriptionintReturns the end index of the entity range on the ancestor side.intReturns the number of entities on the ancestor side.intReturns the start index of the entity range on the ancestor side.booleaninthashCode()intkind()Returns the kind of difference.intleftEnd()Returns the end index of the entity range on the left side.intReturns the number of entities on the left side.intReturns the start index of the entity range on the left side.intReturns the maximum number of entities in the left, right, and ancestor sides of this range.intrightEnd()Returns the end index of the entity range on the right side.intReturns the number of entities on the right side.intReturns the start index of the entity range on the right side.toString()
- 
Field Details- 
NOCHANGEpublic static final int NOCHANGETwo-way change constant indicating no change.- See Also:
 
- 
CHANGEpublic static final int CHANGETwo-way change constant indicating two-way change (same asRIGHT)- See Also:
 
- 
CONFLICTpublic static final int CONFLICTThree-way change constant indicating a change in both right and left.- See Also:
 
- 
RIGHTpublic static final int RIGHTThree-way change constant indicating a change in right.- See Also:
 
- 
LEFTpublic static final int LEFTThree-way change constant indicating a change in left.- See Also:
 
- 
ANCESTORpublic static final int ANCESTORThree-way change constant indicating the same change in both right and left, that is only the ancestor is different.- See Also:
 
- 
ERRORpublic static final int ERRORConstant indicating an unknown change kind.- See Also:
 
- 
kindprotected int kindthe kind of change: NOCHANGE, CHANGE, LEFT, RIGHT, ANCESTOR, CONFLICT, ERROR- Since:
- org.eclipse.compare.core 3.5
 
- 
leftStartprotected int leftStart- Since:
- org.eclipse.compare.core 3.5
 
- 
leftLengthprotected int leftLength- Since:
- org.eclipse.compare.core 3.5
 
- 
rightStartprotected int rightStart- Since:
- org.eclipse.compare.core 3.5
 
- 
rightLengthprotected int rightLength- Since:
- org.eclipse.compare.core 3.5
 
- 
ancestorStartprotected int ancestorStart- Since:
- org.eclipse.compare.core 3.5
 
- 
ancestorLengthprotected int ancestorLength- Since:
- org.eclipse.compare.core 3.5
 
 
- 
- 
Constructor Details- 
RangeDifferenceprotected RangeDifference(int changeKind) Creates a new range difference with the given change kind.- Parameters:
- changeKind- the kind of change
- Since:
- org.eclipse.compare.core 3.5
 
- 
RangeDifferenceprotected RangeDifference(int kind, int rightStart, int rightLength, int leftStart, int leftLength) Creates a newRangeDifferencewith the given change kind and left and right ranges.- Parameters:
- kind- the kind of change
- rightStart- start index of entity on right side
- rightLength- number of entities on right side
- leftStart- start index of entity on left side
- leftLength- number of entities on left side
- Since:
- org.eclipse.compare.core 3.5
 
- 
RangeDifferenceprotected RangeDifference(int kind, int rightStart, int rightLength, int leftStart, int leftLength, int ancestorStart, int ancestorLength) Creates a newRangeDifferencewith the given change kind and left, right, and ancestor ranges.- Parameters:
- kind- the kind of change
- rightStart- start index of entity on right side
- rightLength- number of entities on right side
- leftStart- start index of entity on left side
- leftLength- number of entities on left side
- ancestorStart- start index of entity on ancestor side
- ancestorLength- number of entities on ancestor side
- Since:
- org.eclipse.compare.core 3.5
 
 
- 
- 
Method Details- 
kindpublic int kind()Returns the kind of difference.- Returns:
- the kind of difference, one of
 NOCHANGE,CHANGE,LEFT,RIGHT,ANCESTOR,CONFLICT,ERROR
 
- 
ancestorStartpublic int ancestorStart()Returns the start index of the entity range on the ancestor side.- Returns:
- the start index of the entity range on the ancestor side
 
- 
ancestorLengthpublic int ancestorLength()Returns the number of entities on the ancestor side.- Returns:
- the number of entities on the ancestor side
 
- 
ancestorEndpublic int ancestorEnd()Returns the end index of the entity range on the ancestor side.- Returns:
- the end index of the entity range on the ancestor side
 
- 
rightStartpublic int rightStart()Returns the start index of the entity range on the right side.- Returns:
- the start index of the entity range on the right side
 
- 
rightLengthpublic int rightLength()Returns the number of entities on the right side.- Returns:
- the number of entities on the right side
 
- 
rightEndpublic int rightEnd()Returns the end index of the entity range on the right side.- Returns:
- the end index of the entity range on the right side
 
- 
leftStartpublic int leftStart()Returns the start index of the entity range on the left side.- Returns:
- the start index of the entity range on the left side
 
- 
leftLengthpublic int leftLength()Returns the number of entities on the left side.- Returns:
- the number of entities on the left side
 
- 
leftEndpublic int leftEnd()Returns the end index of the entity range on the left side.- Returns:
- the end index of the entity range on the left side
 
- 
maxLengthpublic int maxLength()Returns the maximum number of entities in the left, right, and ancestor sides of this range.- Returns:
- the maximum number of entities in the left, right, and ancestor sides of this range
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-