| Modifier and Type | Class and Description |
|---|---|
| public static class | DiffHelper.
Class representing one diff operation. |
| public static enum | DiffHelper.
The data structure representing a diff is a Linked list of Diff objects: {Diff(Operation.DELETE, "Hello"), Diff(Operation.INSERT, "Goodbye"), Diff(Operation.EQUAL, " world.")} which means: delete "Hello", add "Goodbye" and keep " world." |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static List | Returns: a list of Diffthe old line text1, AttributedString the new line text2)Compute a list of difference between two lines. |
| DiffHelper | back to summary |
|---|---|
| public DiffHelper() | |
| diff | back to summary |
|---|---|
| public static List Compute a list of difference between two lines. The result will contain at most 4 Diff objects, as the method aims to return the common prefix, inserted text, deleted text and common suffix. The computation is done on characters and their attributes expressed as ansi sequences.
| |
| Modifier and Type | Field and Description |
|---|---|
| public final DiffHelper. | operation
One of: INSERT, DELETE or EQUAL. |
| public final AttributedString | text
The text associated with this diff operation. |
| Access | Constructor and Description |
|---|---|
| public | Diff(DiffHelper.
One of INSERT, DELETE or EQUAL. operation,The text being applied. text)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: text version.Overrides java. Display a human-readable version of this Diff. |
| operation | back to summary |
|---|---|
| public final DiffHelper. One of: INSERT, DELETE or EQUAL. | |
| text | back to summary |
|---|---|
| public final AttributedString text The text associated with this diff operation. | |
| Diff | back to summary |
|---|---|
| public Diff(DiffHelper. Constructor. Initializes the diff with the provided values.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Display a human-readable version of this Diff.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final DiffHelper. | |
| public static final DiffHelper. | |
| public static final DiffHelper. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static DiffHelper. | |
| public static DiffHelper. |
| DELETE | back to summary |
|---|---|
| public static final DiffHelper. | |
| EQUAL | back to summary |
|---|---|
| public static final DiffHelper. | |
| INSERT | back to summary |
|---|---|
| public static final DiffHelper. | |
| Operation | back to summary |
|---|---|
| private Operation() | |
| valueOf | back to summary |
|---|---|
| public static DiffHelper. | |
| values | back to summary |
|---|---|
| public static DiffHelper. | |