difflib
Class Patch

java.lang.Object
  extended by difflib.Patch

public class Patch
extends Object

Describes the patch holding all deltas between the original and revised texts.

Author:
Dmitry Naumenko

Constructor Summary
Patch()
           
 
Method Summary
 void addDelta(Delta delta)
          Add the given delta to this patch
 List<?> applyTo(List<?> target)
          Apply this patch to the given target
 List<Delta> getDeltas()
          Get the list of computed deltas
 List<?> restore(List<?> target)
          Restore the text to original.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Patch

public Patch()
Method Detail

applyTo

public List<?> applyTo(List<?> target)
                throws PatchFailedException
Apply this patch to the given target

Returns:
the patched text
Throws:
PatchFailedException - if can't apply patch

restore

public List<?> restore(List<?> target)
Restore the text to original. Opposite to applyTo() method.

Parameters:
target - the given target
Returns:
the restored text

addDelta

public void addDelta(Delta delta)
Add the given delta to this patch

Parameters:
delta - the given delta

getDeltas

public List<Delta> getDeltas()
Get the list of computed deltas

Returns:
the deltas


Copyright © 2012. All Rights Reserved.