org.sourcejammer.server.source
Class TextDiff
java.lang.Object
|
+--JLibDiff.SJDiff
|
+--org.sourcejammer.server.source.TextDiff
- All Implemented Interfaces:
- define, Delta, HunkVisitable, java.io.Serializable
- public class TextDiff
- extends SJDiff
- implements java.io.Serializable, Delta
Builds a diff from two text files and can reconstruct the second file
when passed the first, using the type of EOL characters requested.
- See Also:
- Serialized Form
Methods inherited from class JLibDiff.SJDiff |
accept, diffBuffer, diffByteArray, diffFile, diffString, diffTextLineIterator, diffTextLineReader, getHunk, getUnderlyingVector, hunkAt, numberOfHunk, print, setEndOfLine, supressEndOfLine |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextDiff
public TextDiff()
- Constructs an empty TextDiff.
TextDiff
public TextDiff(java.util.Vector v)
TextDiff
public TextDiff(TextLineReader fileOne,
TextLineReader fileTwo)
throws java.io.IOException,
EndOfSourceException
- Constructs a TextDiff using the two TextLineReaders.
buildFileTextLineIterator
public TextLineIteratorOutput buildFileTextLineIterator(TextLineIteratorOutput parent)
throws InvalidSourceException,
java.io.IOException,
EndOfSourceException
- Reconstructs fileTwo and returns it as a TextLineIterator.
- Parameters:
parent
- -- fileOne as a TextLineReader.requestedEOL
- - End of Line characters to use in returned file.- Returns:
- a TextLineIterator containing the reconstructed fileTwo used to
originally build this TextDiff.
clipReturnCharFromDiffLine
public java.lang.String clipReturnCharFromDiffLine(java.lang.String line,
java.lang.String sEOL,
int iEOLLength)
- Clips the specified string from the end of the line. Not necessary anymore, I think.
buildFile
public java.io.ByteArrayOutputStream buildFile(SourceInputStream parent,
int iEndOfLineType)
throws InvalidSourceException,
java.io.IOException,
EndOfSourceException
- Builds a text file from the parent using the build steps in this
Delta. Returns the text file, with requested end of line chars, as
a ByteArrayOutputStream.