|
SourceJammer 1.3.0 November 20, 2002 Copyright (c) 2001, 2002 Robert MacGrogan |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | 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.
Fields inherited from interface JLibDiff.define |
DELETE, INSERT, MAXLINES, ORIGIN |
Constructor Summary | |
SJDiff()
Allocates a new diff containing no Hunks. |
|
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(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. |
java.util.Vector |
getUnderlyingVector()
Save Hunks with RCS format at the specified file. |
Hunk |
hunkAt(int i)
Return the hunk at the specified index. |
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 |
Constructor Detail |
public SJDiff()
diff
containing no Hunks.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 Hunk hunkAt(int i)
i
- index of the hunk that will be returned.public void accept(HunkVisitor visitor)
accept
in interface 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.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.public void diffByteArray(byte[] current, byte[] newFile) throws java.io.IOException, EndOfSourceException
public void diffTextLineReader(TextLineReader current, TextLineReader newFile) throws java.io.IOException, EndOfSourceException
public void diffTextLineIterator(TextLineIterator current, TextLineIterator newFile) throws java.io.IOException, EndOfSourceException
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.public void print()
public java.util.Vector getUnderlyingVector()
file
- file in which Hunks will be saved.
|
SourceJammer 1.3.0 November 20, 2002 Copyright (c) 2001, 2002 Robert MacGrogan |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |