public class Diff extends ArrayList<Difference> implements Serializable
modCount| Constructor and Description |
|---|
Diff() |
| Modifier and Type | Method and Description |
|---|---|
Reader |
apply(Reader source)
Apply the difference to the specified source.
|
static Diff |
diff(File f1,
File f2,
boolean ignoreWhitespace)
Computes a diff between two files.
|
static Diff |
diff(List<String> lines1,
List<String> lines2,
boolean ignoreWhitespace)
Compares two "files" that are passed in as a list of lines.
|
static Diff |
diff(Reader r1,
Reader r2,
boolean ignoreWhitespace)
Create the differences of the content two streams.
|
String |
toUnifiedDiff(String name1,
String name2,
Reader r1,
Reader r2,
int numContextLines)
Prints the difference in the unified diff format.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCodeparallelStream, streampublic static Diff diff(File f1, File f2, boolean ignoreWhitespace) throws IOException
IOExceptionpublic static Diff diff(Reader r1, Reader r2, boolean ignoreWhitespace) throws IOException
r1 - the first sourcer2 - the second source to be compared with the first one.IOExceptionpublic static Diff diff(List<String> lines1, List<String> lines2, boolean ignoreWhitespace)
public String toUnifiedDiff(String name1, String name2, Reader r1, Reader r2, int numContextLines) throws IOException
numContextLines - Number of context lines to generate around the diff.IOExceptionpublic Reader apply(Reader source)
source - The source streamIOException - When reading from the source stream failsParseException - When the source does not match the patch to be appliedCopyright © 2011–2019. All rights reserved.