VTT Java
2010 Version

gov.nih.nlm.nls.vtt.Lib
Class DiffUtil

java.lang.Object
  extended by gov.nih.nlm.nls.vtt.Lib.DiffUtil

public class DiffUtil
extends java.lang.Object

This class is modified from FileDiff.java from incava.org. This is the utility class for using Diff class and print results in the format similar to the Unix "diff" program.

History:

Version:
V-2010
Author:
NLM NLS Development Team, clu

Field Summary
protected static java.lang.String ADD_STR
          addition string
protected static java.lang.String CHANGE_STR
          change string
protected static java.lang.String COMMA_STR
          comma string
protected static java.lang.String DELETE_STR
          deletion string
protected static java.lang.String LS_STR
          line separator string
protected static java.lang.String SEP_STR
          separate string
protected static java.lang.String SOURCE_IND_STR
          source indent string
protected static java.lang.String SPACE_STR
          space string
protected static java.lang.String TARGET_IND_STR
          target indent string
 
Method Summary
static java.lang.String GetDiffStr(java.util.Vector<java.lang.String> aLines, java.util.Vector<java.lang.String> bLines)
          Get the difference String.
static java.util.Vector<java.lang.String> GetLinesFromFile(java.lang.String inFile)
          Get the line from a file.
static java.util.Vector<java.lang.String> GetLinesFromStr(java.lang.String inStr)
          Get the line from a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LS_STR

protected static final java.lang.String LS_STR
line separator string


SPACE_STR

protected static final java.lang.String SPACE_STR
space string

See Also:
Constant Field Values

COMMA_STR

protected static final java.lang.String COMMA_STR
comma string

See Also:
Constant Field Values

ADD_STR

protected static final java.lang.String ADD_STR
addition string

See Also:
Constant Field Values

CHANGE_STR

protected static final java.lang.String CHANGE_STR
change string

See Also:
Constant Field Values

DELETE_STR

protected static final java.lang.String DELETE_STR
deletion string

See Also:
Constant Field Values

SEP_STR

protected static final java.lang.String SEP_STR
separate string

See Also:
Constant Field Values

SOURCE_IND_STR

protected static final java.lang.String SOURCE_IND_STR
source indent string

See Also:
Constant Field Values

TARGET_IND_STR

protected static final java.lang.String TARGET_IND_STR
target indent string

See Also:
Constant Field Values
Method Detail

GetDiffStr

public static java.lang.String GetDiffStr(java.util.Vector<java.lang.String> aLines,
                                          java.util.Vector<java.lang.String> bLines)
Get the difference String.

Parameters:
aLines - the first vector of lines to compare
bLines - the second vector of lines to compare
Returns:
the difference string

GetLinesFromFile

public static java.util.Vector<java.lang.String> GetLinesFromFile(java.lang.String inFile)
Get the line from a file.

Parameters:
inFile - the input file
Returns:
a vector of lines form the input file

GetLinesFromStr

public static java.util.Vector<java.lang.String> GetLinesFromStr(java.lang.String inStr)
Get the line from a string.

Parameters:
inStr - the input string
Returns:
a vector of lines form the input string

VTT Java
2010 Version

Submit a bug or feature

Copyright © 2010 National Library of Medicine