byucc.jhdl.util
Class FileDiff

java.lang.Object
  extended bybyucc.jhdl.util.FileDiff

public class FileDiff
extends java.lang.Object


Field Summary
static int ERROR_CODE_INT
           
static java.lang.String USAGE_STRING
           
 
Constructor Summary
FileDiff()
           
 
Method Summary
static int diff(java.io.BufferedReader fileA, java.io.BufferedReader fileB)
          Return the number of different lines in fileA and fileB
static int diff(java.io.File fileA, java.io.File fileB)
          Return the number of different lines in fileA and fileB
static int diff(java.io.FileReader fileA, java.io.FileReader fileB)
          Return the number of different lines in fileA and fileB
static int diff(java.io.Reader fileA, java.io.Reader fileB)
          Return the number of different lines in fileA and fileB
static int diff(java.lang.String fileA, java.lang.String fileB)
          Return the number of different lines in fileA and fileB
static java.lang.String getLastErrorMessage()
          Return last error message
static void main(java.lang.String[] args)
          This method can be used to pass the names of two files to be diffed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USAGE_STRING

public static final java.lang.String USAGE_STRING
See Also:
Constant Field Values

ERROR_CODE_INT

public static final int ERROR_CODE_INT
See Also:
Constant Field Values
Constructor Detail

FileDiff

public FileDiff()
Method Detail

main

public static void main(java.lang.String[] args)
This method can be used to pass the names of two files to be diffed. If there is a difference, the number of different lines is printed to standard error.

Parameters:
args - The arguments must consist of exactly two strings, corresponding to two filenames (including paths, if needed).

getLastErrorMessage

public static java.lang.String getLastErrorMessage()
Return last error message

Returns:
a message that explains the last error encountered, or null if no error has occurred in diffing.

diff

public static int diff(java.lang.String fileA,
                       java.lang.String fileB)
Return the number of different lines in fileA and fileB

Parameters:
fileA - File to compare to fileB
fileB - File to compare to fileA
Returns:
Zero if files identical, ERROR_CODE_INT if an error occurred, or the number of different lines if the files differ

diff

public static int diff(java.io.File fileA,
                       java.io.File fileB)
Return the number of different lines in fileA and fileB

Parameters:
fileA - File to compare to fileB
fileB - File to compare to fileA
Returns:
Zero if files identical, ERROR_CODE_INT if an error occurred, or the number of different lines if the files differ

diff

public static int diff(java.io.FileReader fileA,
                       java.io.FileReader fileB)
Return the number of different lines in fileA and fileB

Parameters:
fileA - File to compare to fileB
fileB - File to compare to fileA
Returns:
Zero if files identical, ERROR_CODE_INT if an error occurred, or the number of different lines if the files differ

diff

public static int diff(java.io.Reader fileA,
                       java.io.Reader fileB)
Return the number of different lines in fileA and fileB

Parameters:
fileA - File to compare to fileB
fileB - File to compare to fileA
Returns:
Zero if files identical, ERROR_CODE_INT if an error occurred, or the number of different lines if the files differ

diff

public static int diff(java.io.BufferedReader fileA,
                       java.io.BufferedReader fileB)
Return the number of different lines in fileA and fileB

Parameters:
fileA - File to compare to fileB
fileB - File to compare to fileA
Returns:
Zero if files identical, ERROR_CODE_INT if an error occurred, or the number of different lines if the files differ


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.