|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--JLibDiff.SJDiff
A modified implimentation of JLibDiff.diff. This version copies most of the code from JLibDiff.diff, but changes addes a method to allow a diff to be build from TextLineReader objects.
Field Summary | |
(package private) java.lang.String |
msEndOfLine
|
(package private) java.util.Vector |
v
|
Fields inherited from interface JLibDiff.define |
DELETE, INSERT, MAXLINES, ORIGIN |
Constructor Summary | |
SJDiff()
Allocates a new diff containing no Hunks. |
|
SJDiff(JLibDiff.diff d)
Build SJDiff from passed in diff. |
|
SJDiff(java.lang.String s1,
java.lang.String s2)
Allocates a new diff which contains Hunks corresponding
to the difference between the two files passed in arguments. |
|
SJDiff(java.util.Vector vec)
Constructs a new diff with the passed-in Vector as the underlying Vector of "hunk"s. |
Method Summary | |
void |
accept(JLibDiff.HunkVisitor visitor)
Accept a visitor in order to visit the collection of hunks. |
void |
diffBuffer(java.io.BufferedReader in,
java.io.BufferedReader inn)
Compares two BufferedReaders and updates the vector of Hunks. |
void |
diffByteArray(byte[] current,
byte[] newFile)
Builds this diff from the two byte arrays, assuming that the byte arrays are text files in byte form. |
void |
diffFile(java.lang.String s1,
java.lang.String s2)
Compares two files and updates the vector of Hunks. |
void |
diffString(java.lang.String s1,
java.lang.String s2)
Compares two strings and updates the vector of Hunks. |
void |
diffTextLineIterator(TextLineIterator current,
TextLineIterator newFile)
Builds this diff from the two TextLineIterator objects. |
void |
diffTextLineReader(TextLineReader current,
TextLineReader newFile)
Builds this diff from the two TextLineReader objects. |
java.util.Vector |
getHunk()
Returns a vector containing Hunks. |
private static java.util.Vector |
getHunk(JLibDiff.edit start,
char[] A,
char[] B)
|
private static java.util.Vector |
getHunk(JLibDiff.edit start,
char[] A,
char[] B,
java.lang.String sEOL)
|
private static java.util.Vector |
getHunk(JLibDiff.edit start,
java.lang.String[] A,
java.lang.String[] B)
|
private static java.util.Vector |
getHunk(JLibDiff.edit start,
java.lang.String[] A,
java.lang.String[] B,
java.lang.String sEOL)
|
java.util.Vector |
getUnderlyingVector()
Save Hunks with RCS format at the specified file. |
JLibDiff.Hunk |
hunkAt(int i)
Return the hunk at the specified index. |
private void |
makeDiff(java.lang.String[] A,
java.lang.String[] B,
int m,
int n)
Internal method, called by diffTextLineReader(), diffByteArray(), and diffBuffer() to build this diff. |
int |
numberOfHunk()
Returns the number of hunks in the vector. |
void |
print()
Print Hunks with normal format. |
void |
setEndOfLine(java.lang.String s)
|
void |
supressEndOfLine()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.util.Vector v
java.lang.String msEndOfLine
Constructor Detail |
public SJDiff()
diff
containing no Hunks.
public SJDiff(JLibDiff.diff d)
public SJDiff(java.util.Vector vec)
public SJDiff(java.lang.String s1, java.lang.String s2) throws java.io.IOException
diff
which contains Hunks corresponding
to the difference between the two files passed in arguments.
s1
- first file to compare.s2
- second file to compare.Method Detail |
public void setEndOfLine(java.lang.String s)
public void supressEndOfLine()
public java.util.Vector getHunk()
public int numberOfHunk()
public JLibDiff.Hunk hunkAt(int i)
i
- index of the hunk that will be returned.public void accept(JLibDiff.HunkVisitor visitor)
accept
in interface JLibDiff.HunkVisitable
visitor
- the HunkVisitor.public void diffFile(java.lang.String s1, java.lang.String s2) throws java.io.IOException
s1
- first file to compare.s2
- second file to compare.
java.io.IOException
public void diffBuffer(java.io.BufferedReader in, java.io.BufferedReader inn) throws java.io.IOException
in
- first BufferedReader to compare.inn
- second BufferedReader to compare.
java.io.IOException
public void diffByteArray(byte[] current, byte[] newFile) throws java.io.IOException, EndOfSourceException
java.io.IOException
EndOfSourceException
public void diffTextLineReader(TextLineReader current, TextLineReader newFile) throws java.io.IOException, EndOfSourceException
java.io.IOException
EndOfSourceException
public void diffTextLineIterator(TextLineIterator current, TextLineIterator newFile) throws java.io.IOException, EndOfSourceException
java.io.IOException
EndOfSourceException
private void makeDiff(java.lang.String[] A, java.lang.String[] B, int m, int n) throws java.io.IOException
java.io.IOException
public void diffString(java.lang.String s1, java.lang.String s2) throws java.io.IOException
s1
- first string to compare.s2
- second string to compare.
java.io.IOException
private static java.util.Vector getHunk(JLibDiff.edit start, java.lang.String[] A, java.lang.String[] B) throws java.io.IOException
java.io.IOException
private static java.util.Vector getHunk(JLibDiff.edit start, java.lang.String[] A, java.lang.String[] B, java.lang.String sEOL) throws java.io.IOException
java.io.IOException
private static java.util.Vector getHunk(JLibDiff.edit start, char[] A, char[] B) throws java.io.IOException
java.io.IOException
private static java.util.Vector getHunk(JLibDiff.edit start, char[] A, char[] B, java.lang.String sEOL) throws java.io.IOException
java.io.IOException
public void print()
public java.util.Vector getUnderlyingVector()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |