SourceJammer 1.3.0 November 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan

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

Fields inherited from interface JLibDiff.define
DELETE, INSERT, MAXLINES, ORIGIN
 
Constructor Summary
TextDiff()
          Constructs an empty TextDiff.
TextDiff(TextLineReader fileOne, TextLineReader fileTwo)
          Constructs a TextDiff using the two TextLineReaders.
TextDiff(java.util.Vector v)
           
 
Method Summary
 java.io.ByteArrayOutputStream buildFile(SourceInputStream parent, int iEndOfLineType)
          Builds a text file from the parent using the build steps in this Delta.
 TextLineIteratorOutput buildFileTextLineIterator(TextLineIteratorOutput parent)
          Reconstructs fileTwo and returns it as a TextLineIterator.
 java.lang.String clipReturnCharFromDiffLine(java.lang.String line, java.lang.String sEOL, int iEOLLength)
          Clips the specified string from the end of the line.
 
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
 

Constructor Detail

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.
Method Detail

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.

SourceJammer 1.3.0 November 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan