difflib
Class DeleteDelta<T>

java.lang.Object
  extended by difflib.Delta<T>
      extended by difflib.DeleteDelta<T>

public class DeleteDelta<T>
extends Delta<T>

Describes the delete-delta between original and revised texts.

Author:
Dmitry Naumenko

Nested Class Summary
 
Nested classes/interfaces inherited from class difflib.Delta
Delta.TYPE
 
Constructor Summary
DeleteDelta(Chunk<T> original, Chunk<T> revised)
          Creates a change delta with the two given chunks.
 
Method Summary
 void applyTo(List<T> target)
          Applies this delta as the patch for a given target
 Delta.TYPE getType()
          Returns the type of delta
 void restore(List<T> target)
          Cancel this delta for a given revised text.
 String toString()
           
 void verify(List<T> 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, wait, wait, wait
 

Constructor Detail

DeleteDelta

public DeleteDelta(Chunk<T> original,
                   Chunk<T> revised)
Creates a change delta with the two given chunks.

Parameters:
original - The original chunk. Must not be null.
revised - The original chunk. Must not be null.
Method Detail

applyTo

public void applyTo(List<T> target)
             throws PatchFailedException
Applies this delta as the patch for a given target

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

restore

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

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

getType

public Delta.TYPE getType()
Description copied from class: Delta
Returns the type of delta

Specified by:
getType in class Delta<T>
Returns:
the type enum

verify

public void verify(List<T> target)
            throws PatchFailedException
Description copied from class: Delta
Verifies that this delta can be used to patch the given text.

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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2013. All Rights Reserved.