difflib
Class ChangeDelta

java.lang.Object
  extended by difflib.Delta
      extended by difflib.ChangeDelta

public class ChangeDelta
extends Delta

Describes the change-delta between original and revised texts.

Author:
Dmitry Naumenko

Constructor Summary
ChangeDelta(Chunk original, Chunk revised)
          
 
Method Summary
 void applyTo(java.util.List<java.lang.Object> target)
          Applies this delta as the patch for a given target
 void restore(java.util.List<java.lang.Object> target)
          Cancel this delta for a given revised text.
 void verify(java.util.List<?> target)
          Verifies that this delta can be used to patch the given text.
 
Methods inherited from class difflib.Delta
equals, getOriginal, getRevised, hashCode, setOriginal, setRevised
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeDelta

public ChangeDelta(Chunk original,
                   Chunk revised)

Method Detail

applyTo

public void applyTo(java.util.List<java.lang.Object> target)
             throws PatchFailedException
Applies this delta as the patch for a given target

Specified by:
applyTo in class Delta
Parameters:
target - the given target
Throws:
PatchFailedException

restore

public void restore(java.util.List<java.lang.Object> target)
Cancel this delta for a given revised text. The action is opposite to patch.

Specified by:
restore in class Delta
Parameters:
target - the given revised text

verify

public void verify(java.util.List<?> target)
            throws PatchFailedException
Verifies that this delta can be used to patch the given text.

Specified by:
verify in class Delta
Parameters:
target - the text to patch.
Throws:
PatchFailedException - if the patch cannot be applied.