public class GuiffySureMerge
extends java.lang.Thread
Guiffy's 3-way smart merge, SureMerge, automatically merges all changes except those which conflict. SureMerge's conflict detection algorithm treats inserts and deletes(not just changes) as conflicts. SureMerge extends its conflict attention span to include modifications very near to each other but not necessarily overlapping. Plus, the Attention Focus Expander option allows the user to expand the conflict/overlap area.
Guiffy compares/merges source(text) files of any type - supports Unicode character set. And, Guiffy accepts all 3 forms of end-of-line.
Example code :
The following instantiates a GuiffySureMerge object
with all its properties set to default.
import com.guiffy.inside.*; ... GuiffySureMerge sMerge = new GuiffySureMerge( );Then, we set GuiffySureMerge's filenames. NOTES: If the ResultFileName is null, the results are NOT saved(written) - its a "check merge" run. If the ParentFileName is null, All the changes are saved as Attentions. And, we setup an exitHook.
sMerge.set1stFile(firFileName); sMerge.set2ndFile(secFileName); sMerge.setParentFile(parFileName); sMerge.setResultFile(resFileName); GuiffyHook hook3way = new GuiffyHook(); hook3way.setGuiffySureMerge(sMerge); sMerge.setGuiffyExit(hook3way);Then, we run GuiffySureMerge.
sMerge.start();Then, (in the exitHook) we check the return status.
if(gsm != null) { int rstat = gsm.getStatus(); if (rstat != GuiffySureMerge.OK) { System.err.println( "SureMerge error: status=" + rstat); System.exit(rstat); }And, if the Merge ran, we get the SureMerge metrics.
System.err.println("NumberofChanges=" + gsm.getNumberofChanges() ); System.err.println("Numberof1stApps=" + gsm.getNumberof1stApplied() ); System.err.println("Numberof2ndApps=" + gsm.getNumberof2ndApplied() ); System.err.println("NumberofAttents=" + gsm.getNumberofAttentions() ); }
Thread
Modifier and Type | Field | Description |
---|---|---|
static int |
CANT_FIND_1STFILE |
|
static int |
CANT_FIND_2NDFILE |
|
static int |
CANT_FIND_PARFILE |
|
static int |
CANT_READ_1STFILE |
|
static int |
CANT_READ_2NDFILE |
|
static int |
CANT_READ_PARFILE |
|
static int |
CANT_WRIT_RESFILE |
|
static int |
ENCODING_NOTAVAIL |
|
static int |
ERRORIS_EXCEPTION |
|
static int |
EVALPER_ISEXPIRED |
|
static int |
ISAFOLDER_1STFILE |
|
static int |
ISAFOLDER_2NDFILE |
|
static int |
ISAFOLDER_PARFILE |
|
static int |
OK |
|
static int |
SUREMERGE_ISCONFUSED |
|
static int |
SUREMERGE_NOTALLOWED |
Constructor | Description |
---|---|
GuiffySureMerge() |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
get1stFileEncoding() |
|
java.lang.String |
get2ndFileEncoding() |
|
int |
getNumberof1stApplied() |
Returns the number of changes applied from 1st.
|
int |
getNumberof2ndApplied() |
Returns the number of changes applied from 2nd.
|
int |
getNumberofAttentions() |
Returns the number of unresolved Attentions.
|
int |
getNumberofChanges() |
Returns the number of change blocks.
|
java.lang.String |
getparFileEncoding() |
|
java.lang.String |
getsavFileEncoding() |
|
int |
getStatus() |
Returns Status of SureMerge Run.
|
void |
run() |
|
void |
set1stFile(java.lang.String firstname) |
Sets the 1st File Name.
|
void |
set1stFileEncoding(java.lang.String encods) |
Sets File Encoding for 1st files.
|
void |
set2ndFile(java.lang.String secndname) |
Sets the 2nd File Name.
|
void |
set2ndFileEncoding(java.lang.String encods) |
Sets File Encoding for 2nd files.
|
void |
setEncodingAutoMode(boolean sam) |
Sets the Encoding AutoMode.
|
void |
setEOLAutoMode(boolean sam) |
Sets the EOL AutoMode.
|
void |
setEOLOption(java.lang.String eolopt) |
Sets Write EOLs option for Saved files.
|
void |
setExpandedBlock(int expblk) |
Sets Block Expander for Minimize Blocks Diff.
|
void |
setFileEncoding(java.lang.String encods) |
Sets File Encoding for 1st, 2nd and Parent files.
|
void |
setGuiffyExit(GuiffyExit hook) |
Sets the GuiffyExit hook of the GuiffySureMerge
If set to null, a previously added GuiffyExit hook will be removed.
|
void |
setIgnoreBlank(boolean ignblk) |
Sets IgnoreBlanklines option true or false.
|
void |
setIgnoreCase(boolean igncas) |
Sets IgnoreCase option true or false.
|
void |
setIgnoreEmbeddedWhiteSpace(boolean igs) |
Sets Ignore Embedded type Whitespace flag.
|
void |
setIgnoreField(int begcol,
int endcol) |
Sets IgnoreField option columns xxx thru yyy.
|
void |
setIgnoreField2(int begcol,
int endcol) |
Sets IgnoreField2 option columns xxx thru yyy.
|
void |
setIgnoreLeadingWhiteSpace(boolean igs) |
Sets Ignore Leading type Whitespace flag.
|
void |
setIgnoreTrailingWhiteSpace(boolean igs) |
Sets Ignore Trailing type Whitespace flag.
|
void |
setIgnoreWhitespace(boolean ignwhi) |
Sets IgnoreWhitespace of all types option true or false.
|
void |
setOEMLicenseKey(java.io.ByteArrayInputStream bais) |
Set License Key based on special OEMKey ByteArrayInputStream
|
void |
setParentFile(java.lang.String parntname) |
Sets the Parent File Name.
|
void |
setParFileEncoding(java.lang.String encods) |
Sets File Encoding for Parent files.
|
void |
setPromote(boolean promo) |
Sets Promote option true or false.
|
void |
setQtRexs(java.lang.String[] rxs,
int rxi) |
Sets Quietly Ignore Regular Expressions list.
|
void |
setQtRexTyps(java.lang.String[] rxs,
java.lang.String[] rxt,
int rxi) |
Sets Quietly Ignore Regular Expressions list and Types.
|
void |
setResultFile(java.lang.String resltname) |
Sets the Result File Name.
|
void |
setSaveEncoding(java.lang.String encods) |
Sets Save Encoding for MergeResult file.
|
void |
setTabSize(int tabsiz) |
Sets Tab Size option.
|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public static final int OK
public static final int CANT_FIND_1STFILE
public static final int CANT_FIND_2NDFILE
public static final int CANT_FIND_PARFILE
public static final int CANT_READ_1STFILE
public static final int CANT_READ_2NDFILE
public static final int CANT_READ_PARFILE
public static final int CANT_WRIT_RESFILE
public static final int ISAFOLDER_1STFILE
public static final int ISAFOLDER_2NDFILE
public static final int ISAFOLDER_PARFILE
public static final int ENCODING_NOTAVAIL
public static final int ERRORIS_EXCEPTION
public static final int EVALPER_ISEXPIRED
public static final int SUREMERGE_ISCONFUSED
public static final int SUREMERGE_NOTALLOWED
public void run()
run
in class java.lang.Thread
public int getStatus()
OK = 0; CANT_FIND_1STFILE = 1; // Can't find 1st file CANT_FIND_2NDFILE = 2; // Can't find 2nd file CANT_FIND_PARFILE = 3; // Can't find Parent file CANT_READ_1STFILE = 4; // Can't read 1st file CANT_READ_2NDFILE = 5; // Can't read 2nd file CANT_READ_PARFILE = 6; // Can't read Parent file CANT_WRIT_RESFILE = 7; // Can't write/create Result file ISAFOLDER_1STFILE = 8; // 1st file is a folder ISAFOLDER_2NDFILE = 9; // 2nd file is a folder ISAFOLDER_PARFILE = 10; // 2nd file is a folder ENCODING_NOTAVAIL = 11; // File Encoding specified NA ERRORIS_EXCEPTION = 12; // Exception // (perhaps, encoding format) EVALPER_ISEXPIRED = 13; // Evaluation period has expired SUREMERGE_ISCONFUSED = 14; // SureMerge is Confused SUREMERGE_NOTALLOWED = 15; // Not allowed, requires eXpert license
public int getNumberofChanges()
public int getNumberof1stApplied()
public int getNumberof2ndApplied()
public int getNumberofAttentions()
public java.lang.String get1stFileEncoding()
public java.lang.String get2ndFileEncoding()
public java.lang.String getparFileEncoding()
public java.lang.String getsavFileEncoding()
public void setGuiffyExit(GuiffyExit hook)
hook
- GuiffyExit hookGuiffyExit
public void setOEMLicenseKey(java.io.ByteArrayInputStream bais)
bais
- the License Key ByteArraryInputStreampublic void set1stFile(java.lang.String firstname)
firstname
- the 1st File name as a complete path.public void set2ndFile(java.lang.String secndname)
secndname
- the 2nd File name as a complete path.public void setParentFile(java.lang.String parntname)
parntname
- the Parent File name as a complete path.public void setResultFile(java.lang.String resltname)
resltname
- the Result File name as a complete path.public void setExpandedBlock(int expblk)
expblk
- the integer value that expands the block resynch
required for Minimize Blocks Diff.public void setFileEncoding(java.lang.String encods)
encods
- the String value of the Encoding such as "ASCII", "UTF8",
"SJIS", "Cp500" (for EBCDIC) etc. - Over 100 formats supported.public void set1stFileEncoding(java.lang.String encods)
encods
- the String value of the Encoding such as "ASCII", "UTF8",
"SJIS", "Cp500" (for EBCDIC) etc. - Over 100 formats supported.public void set2ndFileEncoding(java.lang.String encods)
encods
- the String value of the Encoding such as "ASCII", "UTF8",
"SJIS", "Cp500" (for EBCDIC) etc. - Over 100 formats supported.public void setParFileEncoding(java.lang.String encods)
encods
- the String value of the Encoding such as "ASCII", "UTF8",
"SJIS", "Cp500" (for EBCDIC) etc. - Over 100 formats supported.public void setSaveEncoding(java.lang.String encods)
encods
- the String value of the Encoding such as "ASCII", "UTF8",
"SJIS", "Cp500" (for EBCDIC) etc. - Over 100 formats supported.public void setEncodingAutoMode(boolean sam)
sam
- the boolean value for encoding auto-mode.public void setIgnoreCase(boolean igncas)
igncas
- the boolean value that determines whether case differences
are ignored during the compare.public void setIgnoreField(int begcol, int endcol)
begcol
- the ignore field's beginning columnendcol
- the ignore field's ending column
Tabs are expanded according to the TabSize value prior to
ignoring a fieldpublic void setIgnoreField2(int begcol, int endcol)
begcol
- the ignore field's beginning columnendcol
- the ignore field's ending column
Tabs are expanded according to the TabSize value prior to
ignoring a fieldpublic void setIgnoreWhitespace(boolean ignwhi)
ignwhi
- the boolean value that determines whether whitespace
differences are ignored during the compare.public void setIgnoreLeadingWhiteSpace(boolean igs)
igs
- the boolean value that determines whether leading whitespace
differences are ignored during the compare.public void setIgnoreEmbeddedWhiteSpace(boolean igs)
igs
- the boolean value that determines whether embedded whitespace
differences are ignored during the compare.public void setIgnoreTrailingWhiteSpace(boolean igs)
igs
- the boolean value that determines whether trailing whitespace
differences are ignored during the compare.public void setIgnoreBlank(boolean ignblk)
ignblk
- the boolean value that determines whether blankline
differences are ignored during the compare.public void setPromote(boolean promo)
promo
- the boolean value that determines whether the merge
is done as a Promotion.public void setQtRexs(java.lang.String[] rxs, int rxi)
rxs
- the String array of ignore regular expressions.rxi
- the number of regular expressions.public void setQtRexTyps(java.lang.String[] rxs, java.lang.String[] rxt, int rxi)
rxs
- the String array of ignore regular expressions.rxt
- the String array of Types(Line,Part, or Block).rxi
- the number of regular expressions.public void setTabSize(int tabsiz)
tabsiz
- the int value that specifies tab sizes.
Tabs are expanded for the Ignore Field.public void setEOLOption(java.lang.String eolopt)
eolopt
- the String value of "DOS", "MacOS" or "Unix" specifies
the format for writing End-Of-Lines in Saved Files.public void setEOLAutoMode(boolean sam)
sam
- the boolean value for EOL auto-mode.