com.alkacon.diff
Class Diff

java.lang.Object
  extended by com.alkacon.diff.Diff

public final class Diff
extends java.lang.Object

Calculates the difference from two given input sources.


Method Summary
static void diff(java.lang.String text1, java.lang.String text2, I_DiffOutput output, I_DiffConfiguration config)
          Diffs two texts, outputting the result to the specified DiffOutput instance.
static java.lang.String diffAsHtml(java.lang.String text1, java.lang.String text2, I_HtmlDiffConfiguration config)
          Returns the diff of the given two input texts in HTML format.
static void diffAsHtml(java.lang.String text1, java.lang.String text2, java.io.Writer writer, I_HtmlDiffConfiguration config)
          Diffs two texts, outputting the result as HTML to the specified writer instance.
static java.lang.String diffAsText(java.lang.String text1, java.lang.String text2, I_TextDiffConfiguration config)
          Returns the diff of the given two input texts in plain text format.
static void diffAsText(java.lang.String text1, java.lang.String text2, java.io.Writer writer, I_TextDiffConfiguration config)
          Diffs two texts, outputting the result as plain text to the specified writer instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

diff

public static void diff(java.lang.String text1,
                        java.lang.String text2,
                        I_DiffOutput output,
                        I_DiffConfiguration config)
                 throws java.lang.Exception
Diffs two texts, outputting the result to the specified DiffOutput instance.

Parameters:
text1 - the first text to compare
text2 - the second text to compare
output - the result of the diff is written on this instance
config - the configuration to use
Throws:
java.lang.Exception - the differencing itself should normally not throw exceptions, but the methods on DiffOutput can

diffAsHtml

public static java.lang.String diffAsHtml(java.lang.String text1,
                                          java.lang.String text2,
                                          I_HtmlDiffConfiguration config)
                                   throws java.lang.Exception
Returns the diff of the given two input texts in HTML format.

All lines of the input are included in the output.

Parameters:
text1 - the first text to compare
text2 - the second text to compare
config - the configuration to use
Returns:
the diff of the given two input texts in HTML format
Throws:
java.lang.Exception - the differencing itself should normally not throw exceptions, but the methods on DiffOutput can

diffAsHtml

public static void diffAsHtml(java.lang.String text1,
                              java.lang.String text2,
                              java.io.Writer writer,
                              I_HtmlDiffConfiguration config)
                       throws java.lang.Exception
Diffs two texts, outputting the result as HTML to the specified writer instance.

Parameters:
text1 - the first text to compare
text2 - the second text to compare
writer - the result of the diff is written on this writer
config - the configuration to use
Throws:
java.lang.Exception - the differencing itself should normally not throw exceptions, but the methods on DiffOutput can

diffAsText

public static java.lang.String diffAsText(java.lang.String text1,
                                          java.lang.String text2,
                                          I_TextDiffConfiguration config)
                                   throws java.lang.Exception
Returns the diff of the given two input texts in plain text format.

Parameters:
text1 - the first text to compare
text2 - the second text to compare
config - the configuration to use
Returns:
the diff of the given two input texts in plain text format
Throws:
java.lang.Exception - the differencing itself should normally not throw exceptions, but the methods on DiffOutput can

diffAsText

public static void diffAsText(java.lang.String text1,
                              java.lang.String text2,
                              java.io.Writer writer,
                              I_TextDiffConfiguration config)
                       throws java.lang.Exception
Diffs two texts, outputting the result as plain text to the specified writer instance.

Parameters:
text1 - the first text to compare
text2 - the second text to compare
writer - the result of the diff is written on this writer
config - the configuration to use
Throws:
java.lang.Exception - the differencing itself should normally not throw exceptions, but the methods on DiffOutput can


Copyright © 2005-2011. All Rights Reserved.