T
- The type of the compared elements in the 'lines'.ChangeDelta
, DeleteDelta
, InsertDelta
public abstract class Delta<T> extends Object
Describes the delta between original and revised texts.
Modifier and Type | Class | Description |
---|---|---|
static class |
Delta.TYPE |
Specifies the type of the delta.
|
Modifier and Type | Field | Description |
---|---|---|
static String |
DEFAULT_END |
|
static String |
DEFAULT_START |
Constructor | Description |
---|---|
Delta(Chunk<T> original,
Chunk<T> revised) |
Construct the delta for original and revised chunks
|
Modifier and Type | Method | Description |
---|---|---|
abstract void |
applyTo(List<T> target) |
Applies this delta as the patch for a given target
|
boolean |
equals(Object obj) |
|
Chunk<T> |
getOriginal() |
|
Chunk<T> |
getRevised() |
|
abstract Delta.TYPE |
getType() |
Returns the type of delta
|
int |
hashCode() |
|
abstract void |
verify(List<T> target) |
Verifies that this delta can be used to patch the given text.
|
public static final String DEFAULT_END
public static final String DEFAULT_START
public abstract void verify(List<T> target) throws IllegalStateException
target
- the text to patch.IllegalStateException
- if the patch cannot be applied.public abstract void applyTo(List<T> target) throws IllegalStateException
target
- the given targetIllegalStateException
public abstract Delta.TYPE getType()
Copyright © 2014–2019. All rights reserved.