public class DiffUtil
extends Object
DiffTest
to see the expected inputs and outputs.DiffUtil
Constructor and Description |
---|
DiffUtil() |
Modifier and Type | Method and Description |
---|---|
static List<DiffResult>[] |
diff(Reader source,
Reader target)
This is a diff method with default values.
|
static List<DiffResult>[] |
diff(Reader source,
Reader target,
String addedMarkerStart,
String addedMarkerEnd,
String deletedMarkerStart,
String deletedMarkerEnd,
int margin)
The main entrance of this class.
|
static Diff |
getDiff() |
void |
setDiff(Diff diff) |
public static List<DiffResult>[] diff(Reader source, 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 List<DiffResult>[] diff(Reader source, Reader target, String addedMarkerStart, String addedMarkerEnd, String deletedMarkerStart, 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)