| java.lang.Object org.apache.commons.jrcs.util.ToString org.apache.commons.jrcs.diff.Delta
All known Subclasses: org.apache.commons.jrcs.diff.ChangeDelta, org.apache.commons.jrcs.diff.DeleteDelta, org.apache.commons.jrcs.diff.AddDelta,
Delta | abstract public class Delta extends org.apache.commons.jrcs.util.ToString (Code) | | Holds a "delta" difference between to revisions of a text.
version: $Revision: 15101 $ $Date: 2006-04-12 18:30:19 +0100 (Wed, 12 Apr version: 2006) $ author: Juanco Anez author: Brian McBride See Also: Diff See Also: Chunk See Also: Revision See Also: modifications 27 Apr 2003 bwm Added getOriginal() and See Also: getRevised() accessor methods Added visitor pattern accept() method |
Constructor Summary | |
protected | Delta() Creates an uninitialized delta. | protected | Delta(Chunk orig, Chunk rev) Creates a delta object with the given chunks from the original and
revised texts. |
Method Summary | |
abstract public void | accept(RevisionVisitor visitor) Accepts a visitor. | abstract public void | applyTo(List target) Applies this delta as a patch to the given text. | public Chunk | getOriginal() | public Chunk | getRevised() Accessor method to return the chunk representing the updated sequence of
items. | protected void | init(Chunk orig, Chunk rev) Initializaes the delta with the given chunks from the original and
revised texts. | public static Delta | newDelta(Chunk orig, Chunk rev) Returns a Delta that corresponds to the given chunks in the original and
revised text respectively. | final public void | patch(List target) Applies this delta as a patch to the given text. | abstract public void | toRCSString(StringBuffer s, String EOL) Converts this delta into its RCS style string representation. | public String | toRCSString(String EOL) Converts this delta into its RCS style string representation. | public void | toString(StringBuffer s) Converts this delta into its Unix diff style string representation. | abstract public void | verify(List target) Verifies that this delta can be used to patch the given text. |
Delta | protected Delta()(Code) | | Creates an uninitialized delta.
|
Delta | protected Delta(Chunk orig, Chunk rev)(Code) | | Creates a delta object with the given chunks from the original and
revised texts.
|
accept | abstract public void accept(RevisionVisitor visitor)(Code) | | Accepts a visitor.
See the Visitor pattern in "Design Patterns" by the GOF4.
Parameters: visitor - The visitor. |
applyTo | abstract public void applyTo(List target)(Code) | | Applies this delta as a patch to the given text.
Parameters: target - the text to patch. throws: PatchFailedException - if the patch cannot be applied. |
getOriginal | public Chunk getOriginal()(Code) | | Accessor method to return the chunk representing the original sequence of
items
the original sequence |
getRevised | public Chunk getRevised()(Code) | | Accessor method to return the chunk representing the updated sequence of
items.
the updated sequence |
init | protected void init(Chunk orig, Chunk rev)(Code) | | Initializaes the delta with the given chunks from the original and
revised texts.
|
newDelta | public static Delta newDelta(Chunk orig, Chunk rev)(Code) | | Returns a Delta that corresponds to the given chunks in the original and
revised text respectively.
Parameters: orig - the chunk in the original text. Parameters: rev - the chunk in the revised text. |
toRCSString | abstract public void toRCSString(StringBuffer s, String EOL)(Code) | | Converts this delta into its RCS style string representation.
Parameters: s - a StringBuffer StringBuffer to which the stringrepresentation will be appended. Parameters: EOL - the string to use as line separator. |
toRCSString | public String toRCSString(String EOL)(Code) | | Converts this delta into its RCS style string representation.
Parameters: EOL - the string to use as line separator. |
toString | public void toString(StringBuffer s)(Code) | | Converts this delta into its Unix diff style string representation.
Parameters: s - a StringBuffer StringBuffer to which the stringrepresentation will be appended. |
|
|