Package com.github.difflib.patch
Class AbstractDelta<T>
- java.lang.Object
-
- com.github.difflib.patch.AbstractDelta<T>
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ChangeDelta,DeleteDelta,EqualDelta,InsertDelta
public abstract class AbstractDelta<T> extends java.lang.Object implements java.io.SerializableAbstract delta between a source and a target.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidapplyTo(java.util.List<T> target)booleanequals(java.lang.Object obj)Chunk<T>getSource()Chunk<T>getTarget()DeltaTypegetType()inthashCode()abstract voidrestore(java.util.List<T> target)protected voidverifyChunk(java.util.List<T> target)Verify the chunk of this delta, to fit the target.abstract AbstractDelta<T>withChunks(Chunk<T> original, Chunk<T> revised)Create a new delta of the actual instance with customized chunk data.
-
-
-
Method Detail
-
getType
public DeltaType getType()
-
verifyChunk
protected void verifyChunk(java.util.List<T> target) throws PatchFailedException
Verify the chunk of this delta, to fit the target.- Parameters:
target-- Throws:
PatchFailedException
-
applyTo
public abstract void applyTo(java.util.List<T> target) throws PatchFailedException
- Throws:
PatchFailedException
-
restore
public abstract void restore(java.util.List<T> target)
-
withChunks
public abstract AbstractDelta<T> withChunks(Chunk<T> original, Chunk<T> revised)
Create a new delta of the actual instance with customized chunk data.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-