|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--upidiff.diff.Change
This is the base class for all possible kinds of changes. A change can either be a BlockChange, a LineChange or a CharChange. Each change represents one place where some text - either lines of text or characters - are deleted and some are inserted.
Diff.Change,
Serialized Form| Field Summary | |
protected int |
deleted
The number of lines or characters of the old text changed here. |
protected int |
deletedOffset
Offset of the first deleted item in the old text. |
protected int |
inserted
The number of lines or characters of the new text changed here. |
protected int |
insertedOffset
Offset of the first inserted item in the new text. |
static int |
NEWFILE
A constant defined to name the new file version |
protected Change |
next
Pointer to the next Change in the list or null. |
static int |
NOTMERGED
Indicates that the Change was not yet merged. |
static int |
OLDFILE
A constant defined to name the old file version |
protected Change |
parent
Pointer to the parent Change. |
protected Change |
prev
Pointer to the previous Change in the list or null. |
protected int |
whichVersion
Which Version was was merged. |
| Constructor Summary | |
(package private) |
Change(Diff.Change change,
Change parent)
Creates a new Change object using the result of the diff calculation. |
(package private) |
Change(int deletedOffset,
int insertedOffset,
int deleted,
int inserted,
Change parent)
Creates a new Change object using the given attributes. |
| Method Summary | |
int |
getDeleted()
Returns the amount of the old text changed here. |
int |
getDeletedOffset()
Returns the offset of the first deleted item in the old text. |
int |
getInserted()
Returns the amount of the new text changed here. |
int |
getInsertedOffset()
Returns the offset of the first inserted item in the new text. |
int |
getMergedVersion()
Returns the the Version that was merged or -1 if this Change wasn't merged allready. |
Change |
getNext()
Returns a pointer to the next Change in the list. |
Change |
getParent()
Returns a pointer to the parent Change. |
Change |
getPrev()
Returns a pointer to the previous Change in the list. |
boolean |
isMerged()
Whether or not this Change was already merged. |
void |
setDeleted(int deleted)
Sets the amount of the old text changed here. |
void |
setDeletedOffset(int offset)
Sets the offset of the first deleted item in the old text. |
void |
setInserted(int inserted)
Sets the amount of the new text changed here. |
void |
setInsertedOffset(int offset)
Sets the offset of the first inserted item in the new text. |
void |
setMerged(int whichVersion)
Marks this Change as merged. |
void |
setNext(Change change)
Sets the pointer to the next Change in the list. |
void |
setParent(Change parent)
Reparents the Change with the given paren Change. |
void |
setPrev(Change change)
Sets the pointer to the previous Change in the list. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int NOTMERGED
public static final int OLDFILE
public static final int NEWFILE
protected Change next
protected Change prev
protected Change parent
protected int deleted
getDeleted(),
setDeleted(int)protected int inserted
getInserted(),
setInserted(int)protected int deletedOffset
getDeletedOffset(),
setDeletedOffset(int),
Diff.Change.line0protected int insertedOffset
getInsertedOffset(),
setInsertedOffset(int),
Diff.Change.line1protected int whichVersion
| Constructor Detail |
Change(int deletedOffset,
int insertedOffset,
int deleted,
int inserted,
Change parent)
deletedOffset - First offset in the old file.insertedOffset - First offset in the new file.deleted - Amount of data in the old file.inserted - Amount of data in the new file.parent - Parent change object.
Change(Diff.Change change,
Change parent)
change - Result of the diff calculation.parent - Parent change object.Diff.Change| Method Detail |
public final Change getNext()
public final void setNext(Change change)
change - New next Change.public final Change getPrev()
public final void setPrev(Change change)
change - New previous Change.public final Change getParent()
public final void setParent(Change parent)
parent - New parent Change.public final int getDeleted()
public final void setDeleted(int deleted)
deleted - The new number of lines or characters of the
old text changed here.public final int getInserted()
public final void setInserted(int inserted)
inserted - The new number of lines or characters of the
new text changed here.public final int getDeletedOffset()
public final void setDeletedOffset(int offset)
offset - The new offset of the first deleted item in
the old text.public final int getInsertedOffset()
public final void setInsertedOffset(int offset)
offset - The new offset of the first inserted item in
the new text.public final boolean isMerged()
setMerged(int)public final void setMerged(int whichVersion)
whichVersion - the merged version.
Use OLDFILE or NEWFILE onlyisMerged()public final int getMergedVersion()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||