public class Revision extends ToString
Delta
,
Diff
,
Chunk
,
modifications
27 Apr 2003 bwm
Added visitor pattern Visitor interface and accept() method.
Modifier and Type | Field and Description |
---|---|
(package private) java.util.List |
deltas_ |
Constructor and Description |
---|
Revision()
Creates an empty Revision.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(RevisionVisitor visitor)
Accepts a visitor.
|
void |
addDelta(Delta delta)
Adds a delta to this revision.
|
void |
applyTo(java.util.List target)
Applies the series of deltas in this revision as patches to
the given text.
|
Delta |
getDelta(int i)
Retrieves a delta from this revision by position.
|
void |
insertDelta(Delta delta)
Adds a delta to the start of this revision.
|
java.lang.Object[] |
patch(java.lang.Object[] src)
Applies the series of deltas in this revision as patches to
the given text.
|
int |
size()
Returns the number of deltas in this revision.
|
java.lang.String |
toRCSString()
Converts this delta into its RCS style string representation
using the default line separator.
|
java.lang.String |
toRCSString(java.lang.String EOL)
Converts this delta into its RCS style string representation.
|
void |
toRCSString(java.lang.StringBuffer s)
Converts this revision into its RCS style string representation.
|
void |
toRCSString(java.lang.StringBuffer s,
java.lang.String EOL)
Converts this revision into its RCS style string representation.
|
void |
toString(java.lang.StringBuffer s)
Converts this revision into its Unix diff style string representation.
|
arrayToString, arrayToString, stringToArray, stringToArraya, stringToArrayold, toString
public void addDelta(Delta delta)
delta
- the Delta
to add.public void insertDelta(Delta delta)
delta
- the Delta
to add.public Delta getDelta(int i)
i
- the position of the delta to retrieve.public int size()
public java.lang.Object[] patch(java.lang.Object[] src) throws PatchFailedException
src
- the text to patch, which the method doesn't change.PatchFailedException
- if any of the patches cannot be applied.public void applyTo(java.util.List target) throws PatchFailedException
target
- the text to patch.PatchFailedException
- if any of the patches cannot be applied.public void toString(java.lang.StringBuffer s)
public void toRCSString(java.lang.StringBuffer s, java.lang.String EOL)
s
- a StringBuffer
to which the string
representation will be appended.EOL
- the string to use as line separator.public void toRCSString(java.lang.StringBuffer s)
s
- a StringBuffer
to which the string
representation will be appended.public java.lang.String toRCSString(java.lang.String EOL)
EOL
- the string to use as line separator.public java.lang.String toRCSString()
public void accept(RevisionVisitor visitor)
visitor
- the Visitor
visiting this instanceCopyright 2002 the Apache Software Foundation
Copyright ? 1999-2001 Juancarlo A?ez, Caracas, Venezuela.
All rights reserved
. http://www.suigeneris.org/jrcs