com.jalios.util.diff
Class HunkAdd

java.lang.Object
  extended by com.jalios.util.diff.Hunk
      extended by com.jalios.util.diff.HunkAdd

public class HunkAdd
extends Hunk

The HunkAdd class represents a bloc of difference reliding addition(insertion).


Constructor Summary
HunkAdd()
           
 
Method Summary
 String convert_ED()
          Returns a string representation of the current hunk with ED_script format .
 String convert_RCS()
          Returns a string representation of the current hunk with RCS_script format .
 String convert()
          Returns a string representation of the current hunk with normal format .
 String getAfter()
           
 String getBefore()
           
 String getNewContents()
          Returns string to append.
 int highLine(int filenum)
          Returns the number of high line of file passed in argument .
 int lowLine(int filenum)
          Returns the number of low line of file passed in argument .
 int numLines(int filenum)
          Returns the number of lines consedered in this hunk and which came from file passed in argument .
 String relNum(int filenum, int linenum)
          Returns a string representing the line in file and position passed in argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HunkAdd

public HunkAdd()
Method Detail

getNewContents

public String getNewContents()
Returns string to append.


convert

public String convert()
Returns a string representation of the current hunk with normal format .

Specified by:
convert in class Hunk

convert_ED

public String convert_ED()
Returns a string representation of the current hunk with ED_script format .

Specified by:
convert_ED in class Hunk

convert_RCS

public String convert_RCS()
Returns a string representation of the current hunk with RCS_script format .

Specified by:
convert_RCS in class Hunk

lowLine

public int lowLine(int filenum)
Returns the number of low line of file passed in argument . Lines are inclusif.

Specified by:
lowLine in class Hunk
Parameters:
filenum - The number of file (the first file '0', or the second '1').

highLine

public int highLine(int filenum)
Returns the number of high line of file passed in argument . Lines are inclusif.

Specified by:
highLine in class Hunk
Parameters:
filenum - The number of file (the first file '0', or the second '1').

numLines

public int numLines(int filenum)
Returns the number of lines consedered in this hunk and which came from file passed in argument .

Specified by:
numLines in class Hunk
Parameters:
filenum - The number of file (the first file '0', or the second '1').

relNum

public String relNum(int filenum,
                     int linenum)
Returns a string representing the line in file and position passed in argument.

Specified by:
relNum in class Hunk
Parameters:
filenum - The number of file (the first file '0', or the second '1').
linenum - the number of line that will be returned.

getAfter

public String getAfter()
Specified by:
getAfter in class Hunk
See Also:
Hunk.getAfter()

getBefore

public String getBefore()
Specified by:
getBefore in class Hunk
See Also:
Hunk.getBefore()


Copyright © 2001-2010 Jalios SA. All Rights Reserved.