An edit covers the modified region only. It does not cover a common region.
Regions should be specified using 0 based notation, so add 1 to the start and end marks for line numbers in a file.
An edit where beginA == endA && beginB < endB is an insert edit, that
is sequence B inserted the elements in region [beginB, endB) at
beginA.
An edit where beginA < endA && beginB == endB is a delete edit, that
is sequence B has removed the elements between [beginA, endA).
An edit where beginA < endA && beginB < endB is a replace edit, that
is sequence B has replaced the range of elements between
[beginA, endA) with those found in [beginB, endB).
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Edit.
Type of edit |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public | Edit(int
beginA: start and end of region in sequence A; 0 based. as, int beginB: start and end of region in sequence B; 0 based. bs)Create a new empty edit. |
| public | Edit(int
beginA: start of region in sequence A; 0 based. as, int endA: end of region in sequence A; must be >= as. ae, int beginB: start of region in sequence B; 0 based. bs, int endB: end of region in sequence B; must be > = bs. be)Create a new edit. |
| Modifier and Type | Method and Description |
|---|---|
| public final Edit | |
| public final Edit | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public void | |
| public void | |
| public final int | |
| public final int | |
| public final int | |
| public final int | |
| public final int | |
| public final int | |
| public final Edit. | |
| public int | |
| public final boolean | |
| public final void | shift(int
the region is shifted by this amount, and can be positive or
negative. amount)Move the edit region by the specified amount. |
| public void | |
| public String |
| beginA | back to summary |
|---|---|
| pack-priv int beginA | |
| beginB | back to summary |
|---|---|
| pack-priv int beginB | |
| endA | back to summary |
|---|---|
| pack-priv int endA | |
| endB | back to summary |
|---|---|
| pack-priv int endB | |
| Edit | back to summary |
|---|---|
| public Edit(int as, int bs) Create a new empty edit.
| |
| Edit | back to summary |
|---|---|
| public Edit(int as, int ae, int bs, int be) Create a new edit.
| |
| after | back to summary |
|---|---|
| public final Edit after(Edit cut) Construct a new edit representing the region after cut. | |
| before | back to summary |
|---|---|
| public final Edit before(Edit cut) Construct a new edit representing the region before cut. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| extendA | back to summary |
|---|---|
| public void extendA() Increase | |
| extendB | back to summary |
|---|---|
| public void extendB() Increase | |
| getBeginA | back to summary |
|---|---|
| public final int getBeginA() Get start point in sequence A
| |
| getBeginB | back to summary |
|---|---|
| public final int getBeginB() Get start point in sequence B
| |
| getEndA | back to summary |
|---|---|
| public final int getEndA() Get end point in sequence A
| |
| getEndB | back to summary |
|---|---|
| public final int getEndB() Get end point in sequence B
| |
| getLengthA | back to summary |
|---|---|
| public final int getLengthA() Get length of the region in A
| |
| getLengthB | back to summary |
|---|---|
| public final int getLengthB() Get length of the region in B
| |
| getType | back to summary |
|---|---|
| public final Edit. Get type | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isEmpty | back to summary |
|---|---|
| public final boolean isEmpty() Whether edit is empty
| |
| shift | back to summary |
|---|---|
| public final void shift(int amount) Move the edit region by the specified amount.
| |
| swap | back to summary |
|---|---|
| public void swap() Swap A and B, so the edit goes the other direction. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final Edit. | DELETE
Sequence B has removed the region. |
| public static final Edit. | EMPTY
Sequence A and B have zero length, describing nothing. |
| public static final Edit. | INSERT
Sequence B has inserted the region. |
| public static final Edit. | REPLACE
Sequence B has replaced the region with different content. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Edit. | |
| public static Edit. |
| DELETE | back to summary |
|---|---|
| public static final Edit. Sequence B has removed the region. | |
| EMPTY | back to summary |
|---|---|
| public static final Edit. Sequence A and B have zero length, describing nothing. | |
| INSERT | back to summary |
|---|---|
| public static final Edit. Sequence B has inserted the region. | |
| REPLACE | back to summary |
|---|---|
| public static final Edit. Sequence B has replaced the region with different content. | |
| Type | back to summary |
|---|---|
| private Type() | |
| valueOf | back to summary |
|---|---|
| public static Edit. | |
| values | back to summary |
|---|---|
| public static Edit. | |