|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdifflib.Delta<T>
public abstract class Delta<T>
Describes the delta between original and revised texts.
Nested Class Summary | |
---|---|
static class |
Delta.TYPE
Specifies the type of the delta. |
Constructor Summary | |
---|---|
Delta(Chunk<T> original,
Chunk<T> revised)
Construct the delta for original and revised chunks |
Method Summary | |
---|---|
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 |
restore(List<T> target)
Cancel this delta for a given revised text. |
void |
setOriginal(Chunk<T> original)
|
void |
setRevised(Chunk<T> revised)
|
abstract void |
verify(List<T> target)
Verifies that this delta can be used to patch the given text. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Delta(Chunk<T> original, Chunk<T> revised)
original
- Chunk describing the original text. Must not be null
.revised
- Chunk describing the revised text. Must not be null
.Method Detail |
---|
public abstract void verify(List<T> target) throws PatchFailedException
target
- the text to patch.
PatchFailedException
- if the patch cannot be applied.public abstract void applyTo(List<T> target) throws PatchFailedException
target
- the given target
PatchFailedException
public abstract void restore(List<T> target)
target
- the given revised textpublic abstract Delta.TYPE getType()
public Chunk<T> getOriginal()
public void setOriginal(Chunk<T> original)
original
- The Chunk describing the original text to set.public Chunk<T> getRevised()
public void setRevised(Chunk<T> revised)
revised
- The Chunk describing the revised text to set.public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |