allensoft.diff
Class DiffProcessor

java.lang.Object
  |
  +--allensoft.diff.DiffProcessor

public class DiffProcessor
extends java.lang.Object

Proceses differences and applies them to a Reader. The output is controlled by overridable printXXXX methods. By default these methods simply output the result of applying the differences to System.out.


Constructor Summary
DiffProcessor(java.io.Reader file1, DiffParser diffParser)
          Creates a new DiffProcessor that applies the differnces returned from diffParser to file1.
 
Method Summary
protected  void printLineInFile1(int nLineNum, DiffType type, java.lang.String sLine)
          Displays a line in File1.
protected  void printLineInFile2(int nLineNum, DiffType type, java.lang.String sLine)
          Displays a line in File2.
protected  void printNonExistantLineInFile1()
          Displays a non-existant line in File1.
protected  void printNonExistantLineInFile2()
          Displays a non-existant line in File2.
 void run()
          Runs this DiffProcessor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiffProcessor

public DiffProcessor(java.io.Reader file1,
                     DiffParser diffParser)
Creates a new DiffProcessor that applies the differnces returned from diffParser to file1.
Method Detail

run

public void run()
         throws java.io.IOException,
                DiffException
Runs this DiffProcessor.

printLineInFile1

protected void printLineInFile1(int nLineNum,
                                DiffType type,
                                java.lang.String sLine)
Displays a line in File1. File1 is the file provided by the Reader supplied at construction time.

printNonExistantLineInFile1

protected void printNonExistantLineInFile1()
Displays a non-existant line in File1. File1 is the file provided by the Reader supplied at construction time.

printLineInFile2

protected void printLineInFile2(int nLineNum,
                                DiffType type,
                                java.lang.String sLine)
Displays a line in File2. File2 is the file resulting from applying the differences to File1.

printNonExistantLineInFile2

protected void printNonExistantLineInFile2()
Displays a non-existant line in File2. File2 is the file resulting from applying the differences to File1.