Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.compare.rangedifferencer
Class RangeDifference  view RangeDifference download RangeDifference.java

java.lang.Object
  extended byorg.eclipse.compare.rangedifferencer.RangeDifference
Direct Known Subclasses:
LinkedRangeDifference

public class RangeDifference
extends java.lang.Object

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 or subclassed.

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.


Field Summary
static int ANCESTOR
          Three-way change constant indicating the same change in both right and left, that is only the ancestor is different.
static int CHANGE
          Two-way change constant indicating two-way change (same as RIGHT)
static int CONFLICT
          Three-way change constant indicating a change in both right and left.
static int ERROR
          Constant indicating an unknown change kind.
(package private)  int fKind
          the kind of change: NOCHANGE, CHANGE, LEFT, RIGHT, ANCESTOR, CONFLICT, ERROR
(package private)  int fLeftLength
           
(package private)  int fLeftStart
           
(package private)  int fRightLength
           
(package private)  int fRightStart
           
(package private)  int lAncestorLength
           
(package private)  int lAncestorStart
           
static int LEFT
          Three-way change constant indicating a change in left.
static int NOCHANGE
          Two-way change constant indicating no change.
static int RIGHT
          Three-way change constant indicating a change in right.
 
Constructor Summary
(package private) RangeDifference(int changeKind)
          Creates a new range difference with the given change kind.
(package private) RangeDifference(int kind, int rightStart, int rightLength, int leftStart, int leftLength)
          Creates a new RangeDifference with the given change kind and left and right ranges.
(package private) RangeDifference(int kind, int rightStart, int rightLength, int leftStart, int leftLength, int ancestorStart, int ancestorLength)
          Creates a new RangeDifference with the given change kind and left, right, and ancestor ranges.
 
Method Summary
 int ancestorEnd()
          Returns the end index of the entity range on the ancestor side.
 int ancestorLength()
          Returns the number of entities on the ancestor side.
 int ancestorStart()
          Returns the start index of the entity range on the ancestor side.
 int kind()
          Returns the kind of difference.
 int leftEnd()
          Returns the end index of the entity range on the left side.
 int leftLength()
          Returns the number of entities on the left side.
 int leftStart()
          Returns the start index of the entity range on the left side.
 int maxLength()
          Returns the maximum number of entities in the left, right, and ancestor sides of this range.
 int rightEnd()
          Returns the end index of the entity range on the right side.
 int rightLength()
          Returns the number of entities on the right side.
 int rightStart()
          Returns the start index of the entity range on the right side.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOCHANGE

public static final int NOCHANGE
Two-way change constant indicating no change.

See Also:
Constant Field Values

CHANGE

public static final int CHANGE
Two-way change constant indicating two-way change (same as RIGHT)

See Also:
Constant Field Values

CONFLICT

public static final int CONFLICT
Three-way change constant indicating a change in both right and left.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Three-way change constant indicating a change in right.

See Also:
Constant Field Values

LEFT

public static final int LEFT
Three-way change constant indicating a change in left.

See Also:
Constant Field Values

ANCESTOR

public static final int ANCESTOR
Three-way change constant indicating the same change in both right and left, that is only the ancestor is different.

See Also:
Constant Field Values

ERROR

public static final int ERROR
Constant indicating an unknown change kind.

See Also:
Constant Field Values

fKind

int fKind
the kind of change: NOCHANGE, CHANGE, LEFT, RIGHT, ANCESTOR, CONFLICT, ERROR


fLeftStart

int fLeftStart

fLeftLength

int fLeftLength

fRightStart

int fRightStart

fRightLength

int fRightLength

lAncestorStart

int lAncestorStart

lAncestorLength

int lAncestorLength
Constructor Detail

RangeDifference

RangeDifference(int changeKind)
Creates a new range difference with the given change kind.


RangeDifference

RangeDifference(int kind,
                int rightStart,
                int rightLength,
                int leftStart,
                int leftLength)
Creates a new RangeDifference with the given change kind and left and right ranges.


RangeDifference

RangeDifference(int kind,
                int rightStart,
                int rightLength,
                int leftStart,
                int leftLength,
                int ancestorStart,
                int ancestorLength)
Creates a new RangeDifference with the given change kind and left, right, and ancestor ranges.

Method Detail

kind

public int kind()
Returns the kind of difference.


ancestorStart

public int ancestorStart()
Returns the start index of the entity range on the ancestor side.


ancestorLength

public int ancestorLength()
Returns the number of entities on the ancestor side.


ancestorEnd

public int ancestorEnd()
Returns the end index of the entity range on the ancestor side.


rightStart

public int rightStart()
Returns the start index of the entity range on the right side.


rightLength

public int rightLength()
Returns the number of entities on the right side.


rightEnd

public int rightEnd()
Returns the end index of the entity range on the right side.


leftStart

public int leftStart()
Returns the start index of the entity range on the left side.


leftLength

public int leftLength()
Returns the number of entities on the left side.


leftEnd

public int leftEnd()
Returns the end index of the entity range on the left side.


maxLength

public int maxLength()
Returns the maximum number of entities in the left, right, and ancestor sides of this range.