public class DiffUtil
extends java.lang.Object
DiffTest
to see the expected inputs and outputs.DiffUtil
Constructor and Description |
---|
DiffUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<DiffResult>[] |
diff(java.io.Reader source,
java.io.Reader target)
This is a diff method with default values.
|
static java.util.List<DiffResult>[] |
diff(java.io.Reader source,
java.io.Reader target,
java.lang.String addedMarkerStart,
java.lang.String addedMarkerEnd,
java.lang.String deletedMarkerStart,
java.lang.String deletedMarkerEnd,
int margin)
The main entrance of this class.
|
static Diff |
getDiff() |
void |
setDiff(Diff diff) |
public static java.util.List<DiffResult>[] diff(java.io.Reader source, java.io.Reader target)
source
- the source texttarget
- the modified version of the source textDiffResults
, the
first element contains DiffResults related to changes in source
and the second element to changes in targetpublic static java.util.List<DiffResult>[] diff(java.io.Reader source, java.io.Reader target, java.lang.String addedMarkerStart, java.lang.String addedMarkerEnd, java.lang.String deletedMarkerStart, java.lang.String deletedMarkerEnd, int margin)
DiffResults
.source
- the source texttarget
- the modified version of the source textaddedMarkerStart
- the marker to indicate the start of text added
to the sourceaddedMarkerEnd
- the marker to indicate the end of text added to
the sourcedeletedMarkerStart
- the marker to indicate the start of text
deleted from the sourcedeletedMarkerEnd
- the marker to indicate the end of text deleted
from the sourcemargin
- the vertical margin to use in displaying differences
between changed line changesDiffResults
, the
first element contains DiffResults related to changes in source
and the second element to changes in targetpublic static Diff getDiff()
public void setDiff(Diff diff)