org.apache.wicket.util.diff
Class AddDelta

java.lang.Object
  extended by org.apache.wicket.util.diff.ToString
      extended by org.apache.wicket.util.diff.Delta
          extended by org.apache.wicket.util.diff.AddDelta

public class AddDelta
extends Delta

Holds an add-delta between to revisions of a text.

Version:
$Id: AddDelta.java,v 1.1 2006/03/12 00:24:21 juanca Exp $
Author:
Juanco Anez
See Also:
Delta, Diff, Chunk

Field Summary
 
Fields inherited from class org.apache.wicket.util.diff.Delta
original, revised
 
Constructor Summary
AddDelta(int origpos, Chunk rev)
          Construct.
 
Method Summary
 void accept(RevisionVisitor visitor)
          Accepts a visitor.
 void applyTo(java.util.List target)
          Applies this delta as a patch to the given text.
 void toRCSString(java.lang.StringBuffer s, java.lang.String EOL)
          Converts this delta into its RCS style string representation.
 void toString(java.lang.StringBuffer s)
          Converts this delta into its Unix diff style string representation.
 void verify(java.util.List target)
          Verifies that this delta can be used to patch the given text.
 
Methods inherited from class org.apache.wicket.util.diff.Delta
getOriginal, getRevised, init, newDelta, patch, toRCSString
 
Methods inherited from class org.apache.wicket.util.diff.ToString
arrayToString, arrayToString, stringToArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AddDelta

public AddDelta(int origpos,
                Chunk rev)
Construct.

Parameters:
origpos -
rev -
Method Detail

verify

public void verify(java.util.List 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
Parameters:
target - the text to patch.
Throws:
PatchFailedException - if the patch cannot be applied.
See Also:
Delta.verify(java.util.List)

applyTo

public void applyTo(java.util.List target)
Description copied from class: Delta
Applies this delta as a patch to the given text.

Specified by:
applyTo in class Delta
Parameters:
target - the text to patch.
See Also:
Delta.applyTo(java.util.List)

toString

public void toString(java.lang.StringBuffer s)
Description copied from class: Delta
Converts this delta into its Unix diff style string representation.

Overrides:
toString in class Delta
Parameters:
s - a StringBuffer to which the string representation will be appended.
See Also:
Delta.toString(java.lang.StringBuffer)

toRCSString

public void toRCSString(java.lang.StringBuffer s,
                        java.lang.String EOL)
Description copied from class: Delta
Converts this delta into its RCS style string representation.

Specified by:
toRCSString in class Delta
Parameters:
s - a StringBuffer to which the string representation will be appended.
EOL - the string to use as line separator.
See Also:
Delta.toRCSString(java.lang.StringBuffer, java.lang.String)

accept

public void accept(RevisionVisitor visitor)
Description copied from class: Delta
Accepts a visitor.

See the Visitor pattern in "Design Patterns" by the GOF4.

Specified by:
accept in class Delta
Parameters:
visitor - The visitor.
See Also:
Delta.accept(org.apache.wicket.util.diff.RevisionVisitor)


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.