Package org.tmatesoft.svn.core.io.diff
Class SVNDiffInstruction
java.lang.Object
org.tmatesoft.svn.core.io.diff.SVNDiffInstruction
The SVNDiffInstruction class represents instructions used as delta
applying rules.
For now there are three types of copy instructions:
-
COPY_FROM_SOURCE
: that is when bytes are copied from a source view (for example, existing revision of a file) to the target one. -
COPY_FROM_NEW_DATA
: new data bytes (e.g. new text) are copied to the target view. -
COPY_FROM_TARGET
: that is, when a sequence of bytes in the target must be repeated.
- Since:
- 1.2
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
A type of an instruction that says that data must be copied from the new data to the target view.static final int
A type of an instruction that says that data must be copied from the source view to the target one.static final int
A type of an instruction that says that data must be copied from the target view to the target itself.int
A length bytes to copy.int
An offset in the source from where the bytes should be copied.int
A type of this instruction. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instruction object.SVNDiffInstruction
(int t, int l, int o) Creates a particular type of a diff instruction. -
Method Summary
Modifier and TypeMethodDescriptiontoString()
Gives a string representation of this object.static void
writeInt
(ByteBuffer os, int i) Writes an integer to a byte buffer.static void
writeLong
(ByteBuffer os, long i) Writes a long to a byte buffer.void
writeTo
(ByteBuffer target) Wirtes this instruction to a byte buffer.
-
Field Details
-
COPY_FROM_SOURCE
public static final int COPY_FROM_SOURCEA type of an instruction that says that data must be copied from the source view to the target one.- See Also:
-
COPY_FROM_TARGET
public static final int COPY_FROM_TARGETA type of an instruction that says that data must be copied from the target view to the target itself.- See Also:
-
COPY_FROM_NEW_DATA
public static final int COPY_FROM_NEW_DATAA type of an instruction that says that data must be copied from the new data to the target view.- See Also:
-
type
public int typeA type of this instruction. -
length
public int lengthA length bytes to copy. -
offset
public int offsetAn offset in the source from where the bytes should be copied. Instruction offsets are relative to the bounds of views, i.e. a source/target view is a window of bytes (specified in a concrete diff window) in the source/target stream (this can be a file, a buffer).
-
-
Constructor Details
-
SVNDiffInstruction
public SVNDiffInstruction(int t, int l, int o) Creates a particular type of a diff instruction. Instruction offsets are relative to the bounds of views, i.e. a source/target view is a window of bytes (specified in a concrete diff window) in the source/target stream (this can be a file, a buffer).- Parameters:
t
- a type of an instructionl
- a number of bytes to copyo
- an offset in the source (which may be a source or a target view, or a new data stream) from where the bytes are to be copied- See Also:
-
SVNDiffInstruction
public SVNDiffInstruction()Creates a new instruction object. It's the instruction for the empty contents file.
-
-
Method Details
-
toString
Gives a string representation of this object. -
writeTo
Wirtes this instruction to a byte buffer.- Parameters:
target
- a byte buffer to write to
-
writeInt
Writes an integer to a byte buffer.- Parameters:
os
- a byte buffer to write toi
- an integer to write
-
writeLong
Writes a long to a byte buffer.- Parameters:
os
- a byte buffer to write toi
- a long number to write
-