JLibDiff
Class Hunk3

java.lang.Object
  |
  +--JLibDiff.Hunk3

public class Hunk3
extends java.lang.Object

Version:
$VerNum: 2$ $KeyWordsOff: $

The Hunk3 class represents a bloc of difference of three files or three Buffers.
Author:
$AuthorName: Rob MacGrogan$

Field Summary
(package private)  java.util.Vector a
           
(package private)  java.util.Vector b
           
(package private)  java.util.Vector c
           
(package private)  DiffType diff
           
private  java.util.ArrayList file0Lines
           
private  java.util.ArrayList file1Lines
           
private  java.util.ArrayList file2Lines
           
(package private)  int[][] range
           
private  Hunk3Type type
           
 
Constructor Summary
Hunk3()
          Allocates a new Hunk3.
 
Method Summary
 void accpet(Hunk3Visitor visitor)
           
 java.lang.String convert()
          Returns a string representation of the current Hunk with normal format.
 java.util.ArrayList getFile0Lines()
          Returns the file0Lines.
 java.util.ArrayList getFile1Lines()
          Returns the file1Lines.
 java.util.ArrayList getFile2Lines()
          Returns the file2Lines.
 int getMaxRange()
          Returns the maximum range for this hunk3.
 Hunk3Type getType()
          Returns the type.
 int highLine(int filenum)
          Returns the value of position of bloc end line reliding the file passed in argument.
 int lowLine(int filenum)
          Returns the value of position of bloc start line reliding the file passed in argument.
 int numLines(int filenum)
          Returns the number of lines reliding this bloc of difference and the file passed in argument.
 void setFile0Lines(java.util.ArrayList file0Lines)
          Sets the file0Lines.
 void setFile1Lines(java.util.ArrayList file1Lines)
          Sets the file1Lines.
 void setFile2Lines(java.util.ArrayList file2Lines)
          Sets the file2Lines.
 void setRange(int low0, int high0, int low1, int high1, int lowc, int highc)
          Set range of difference which consern this bloc in etch file by values passed in argument.
 void setType(Hunk3Type type)
          Sets the type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

diff

DiffType diff

range

int[][] range

type

private Hunk3Type type

file0Lines

private java.util.ArrayList file0Lines

file1Lines

private java.util.ArrayList file1Lines

file2Lines

private java.util.ArrayList file2Lines

a

java.util.Vector a

b

java.util.Vector b

c

java.util.Vector c
Constructor Detail

Hunk3

public Hunk3()
Allocates a new Hunk3.

Method Detail

setRange

public void setRange(int low0,
                     int high0,
                     int low1,
                     int high1,
                     int lowc,
                     int highc)
Set range of difference which consern this bloc in etch file by values passed in argument.

Parameters:
low0 - start position of bloc of difference in the first file.
high0 - end position of bloc ob difference in thefirst file.
low1 - start position of bloc of difference in the second file.
high1 - end position of bloc ob difference in the second file.
lowc - start position of bloc of difference in the therd file.
highc - end position of bloc ob difference in the therd file.

convert

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


lowLine

public int lowLine(int filenum)
Returns the value of position of bloc start line reliding the file passed in argument.

Parameters:
filenum - file number which can be: 0 to indicate first file. 1 to indicate second file. 2 to indicate therd file.

highLine

public int highLine(int filenum)
Returns the value of position of bloc end line reliding the file passed in argument.

Parameters:
filenum - file number which can be: 0 to indicate first file. 1 to indicate second file. 2 to indicate therd file.

numLines

public int numLines(int filenum)
Returns the number of lines reliding this bloc of difference and the file passed in argument.

Parameters:
filenum - file number which can be: 0 to indicate first file. 1 to indicate second file. 2 to indicate therd file.

accpet

public void accpet(Hunk3Visitor visitor)

getMaxRange

public int getMaxRange()
Returns the maximum range for this hunk3. That is, the greatest difference between high line and low line in a single file.


getFile0Lines

public java.util.ArrayList getFile0Lines()
Returns the file0Lines.

Returns:
ArrayList

getFile1Lines

public java.util.ArrayList getFile1Lines()
Returns the file1Lines.

Returns:
ArrayList

getFile2Lines

public java.util.ArrayList getFile2Lines()
Returns the file2Lines.

Returns:
ArrayList

setFile0Lines

public void setFile0Lines(java.util.ArrayList file0Lines)
Sets the file0Lines.

Parameters:
file0Lines - The file0Lines to set

setFile1Lines

public void setFile1Lines(java.util.ArrayList file1Lines)
Sets the file1Lines.

Parameters:
file1Lines - The file1Lines to set

setFile2Lines

public void setFile2Lines(java.util.ArrayList file2Lines)
Sets the file2Lines.

Parameters:
file2Lines - The file2Lines to set

getType

public Hunk3Type getType()
Returns the type.

Returns:
Hunk3Type

setType

public void setType(Hunk3Type type)
Sets the type.

Parameters:
type - The type to set


Copyright 2003 Soucejammer project.