org.sourcejammer.server.source
Class TextDiff

java.lang.Object
  |
  +--JLibDiff.diff
        |
        +--JLibDiff.SJDiff
              |
              +--org.sourcejammer.server.source.TextDiff
All Implemented Interfaces:
JLibDiff.define, Delta, JLibDiff.HunkVisitable, java.io.Serializable

public class TextDiff
extends SJDiff
implements java.io.Serializable, Delta

Title: $FileName: TextDiff.java$

Version:
$VerNum: 2$ $KeyWordsOff: $

Builds a diff from two text files and can reconstruct the second file when passed the first, using the type of EOL characters requested.
Author:
$AuthorName: Rob MacGrogan$
See Also:
Serialized Form

Field Summary
private  int miEOL
           
 
Fields inherited from class JLibDiff.diff
 
Fields inherited from interface JLibDiff.define
DELETE, INSERT, MAXLINES, ORIGIN
 
Constructor Summary
TextDiff()
          Constructs an empty TextDiff.
TextDiff(JLibDiff.diff d)
           
TextDiff(TextLineReader fileOne, TextLineReader fileTwo)
          Constructs a TextDiff using the two TextLineReaders.
TextDiff(java.util.Vector v)
           
 
Method Summary
 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
diffTextLineIterator, diffTextLineReader
 
Methods inherited from class JLibDiff.diff
accept, diffBuffer, diffFile, getDiffAlgorithmClass, getHunk, getUnderlyingVector, hunkAt, makeDiff, numberOfHunk, print, setDiffAlgorithmClass, supressEndOfLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

miEOL

private int miEOL
Constructor Detail

TextDiff

public TextDiff()
Constructs an empty TextDiff.


TextDiff

public TextDiff(JLibDiff.diff d)

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.
Returns:
a TextLineIterator containing the reconstructed fileTwo used to originally build this TextDiff.
InvalidSourceException
java.io.IOException
EndOfSourceException

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.



Copyright © 2003 Soucejammer project.