T
- The type of the compared elements in the 'lines'.public abstract class Delta<T>
extends java.lang.Object
Describes the delta between original and revised texts.
Modifier and Type | Class and Description |
---|---|
static class |
Delta.TYPE
Specifies the type of the delta.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_END |
static java.lang.String |
DEFAULT_START |
private Chunk<T> |
original
The original chunk.
|
private Chunk<T> |
revised
The revised chunk.
|
Constructor and Description |
---|
Delta(Chunk<T> original,
Chunk<T> revised)
Construct the delta for original and revised chunks
|
Modifier and Type | Method and Description |
---|---|
abstract void |
applyTo(java.util.List<T> target)
Applies this delta as the patch for a given target
|
boolean |
equals(java.lang.Object obj) |
Chunk<T> |
getOriginal() |
Chunk<T> |
getRevised() |
abstract Delta.TYPE |
getType()
Returns the type of delta
|
int |
hashCode() |
int |
lineNumber() |
java.lang.String |
toString() |
abstract void |
verify(java.util.List<T> target)
Verifies that this delta can be used to patch the given text.
|
public static final java.lang.String DEFAULT_END
public static final java.lang.String DEFAULT_START
public abstract void verify(java.util.List<T> target) throws java.lang.IllegalStateException
target
- the text to patch.java.lang.IllegalStateException
- if the patch cannot be applied.public abstract void applyTo(java.util.List<T> target) throws java.lang.IllegalStateException
target
- the given targetjava.lang.IllegalStateException
- if verify(List)
failspublic abstract Delta.TYPE getType()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int lineNumber()
public java.lang.String toString()
toString
in class java.lang.Object