public class Hunk3
extends java.lang.Object
getLeftRange()
is not
null
), or a change on the right side (for which
getRightRange()
is not null
. if the left and the right
ranges are null
this hunk represents an unmodified block of the
base document. if both ranges are NOT null
it represents a
conflicting block.Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
MARKER_B
the base document marker pattern
|
static java.lang.String[] |
MARKER_L
the left document marker pattern
|
static java.lang.String[] |
MARKER_M
the separation marker pattern
|
static java.lang.String[] |
MARKER_R
the right document marker pattern
|
Constructor and Description |
---|
Hunk3(Range base,
Range left,
Range right,
Hunk3 prev)
Constructs a new hunk and appends it to the previous one.
|
Modifier and Type | Method and Description |
---|---|
Range |
getBaseRange()
Returns the range of the base document this hunk spans.
|
Range |
getLeftRange()
Returns the range of the left document this hunk spans.
|
static java.lang.String |
getMarker(java.lang.String[] fmt,
Document doc)
Returns the marker string for the given format and document
|
Range |
getRightRange()
Returns the range of the right document this hunk spans.
|
Hunk3 |
next()
Returns the next hunk in this chain or
null of this hunk is
the last one. |
java.lang.String |
toString()
generate a debug string
|
void |
write(DiffWriter out,
boolean showBase)
Writes this hunk to a writer.
|
public static final java.lang.String[] MARKER_L
public static final java.lang.String[] MARKER_R
public static final java.lang.String[] MARKER_B
public static final java.lang.String[] MARKER_M
public Hunk3 next()
null
of this hunk is
the last one.public Range getBaseRange()
public Range getLeftRange()
null
.public Range getRightRange()
null
.public void write(DiffWriter out, boolean showBase) throws java.io.IOException
out
- the writershowBase
- include the block of the base document in case of a
conflict as well.java.io.IOException
- if a I/O error occurs.public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String getMarker(java.lang.String[] fmt, Document doc)
fmt
- the marker formatdoc
- the document or null
."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"