int length1 = getLength1(); int length2 = getLength2(); if (length1 == 0 || length2 == 0) { length = 0; if ((double) length1 * (double) length2 > settings.getTooLong()) { .getPowLimit() - 1.0); initializeLcs(length1); int max = Math.min(length1, length2); for (forwardBound = 0; forwardBound < max && isRangeEqual(forwardBound, forwardBound); forwardBound++) { setLcs(forwardBound, forwardBound); && isRangeEqual(backBoundL1, backBoundL2)) { setLcs(backBoundL1, backBoundL2); backBoundL1--; backBoundL2--; - backBoundL1 - 1 + lcs_rec(forwardBound, backBoundL1, forwardBound, backBoundL2, new int[2][length1 + length2 + 1], new int[3]);
int d = find_middle_snake(bottoml1, topl1, bottoml2, topl2, V, snake); setLcs(startx + i, starty + i); + lcs_rec(bottoml1, startx - 1, bottoml2, starty - 1, V, snake) + lcs_rec(startx + len, topl1, starty + len, topl2, V, snake); } else if (d == 1) { setLcs(bottoml1 + i, bottoml2 + i);
/** * Finds the differences between two <code>IRangeComparator</code>s. The * differences are returned as an array of <code>RangeDifference</code>s. * If no differences are detected an empty array is returned. * * @param left * the left range comparator * @param right * the right range comparator * @return an array of range differences, or an empty array if no * differences were found */ public static RangeDifference[] findDifferences(IRangeComparator left, IRangeComparator right) { return findDifferences( new LCSSettings(), left, right); }
public double getMatchRatio(StringComparator other) { LCSSettings settings = new LCSSettings(); settings.setUseGreedyMethod(true); settings.setPowLimit(1.5); settings.setTooLong(150 * 150); RangeDifference[] differences = RangeDifferencer.findDifferences( settings, other, this); int distanceOther = 0; for (RangeDifference d : differences) { distanceOther += d.leftLength(); } int distanceThis = 0; for (RangeDifference d : differences) { distanceThis += d.rightLength(); } return ((0.0 + distanceOther) / other.getRangeCount() + (0.0 + distanceThis) / getRangeCount()) / 2; } }
public ResizableDialog(Shell parent, ResourceBundle bundle) { super(parent); setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX); fBundle= bundle; fSettings= CompareUIPlugin.getDefault().getDialogSettings(); }
public void reset() { if (fCreator != null) fCreator.removePropertyChangeListener(this); fCreator = null; OutlineViewerCreator creator = getCreator(); if (creator != null) setInput(creator.getInput()); else setInput(null); } }
&& isRangeEqual(x + bottoml1, y + bottoml2)) { x++; y++; && isRangeEqual(x - 1 + bottoml1, y - 1 + bottoml2)) { x--; y--; int[] most_progress = findMostProgress(M, N, limit, V);
/** * Handles the given <code>InvocationTargetException</code>. The workbench shell is used * as a parent for the dialog window. * * @param e the <code>InvocationTargetException</code> to be handled * @param title the dialog window's window title * @param message message to be displayed by the dialog window */ public static void handle(InvocationTargetException e, String title, String message) { handle(e, CompareUIPlugin.getShell(), title, message); }
@Override public void initializeDefaultPreferences() { IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore(); ComparePreferencePage.initDefaults(store); }
public ChangePropertyAction(ResourceBundle bundle, CompareConfiguration cc, String rkey, String pkey) { fPropertyKey= pkey; fBundle= bundle; fPrefix= rkey; Utilities.initAction(this, fBundle, fPrefix); setCompareConfiguration(cc); }
protected WorkerJob createWorkerJob() { WorkerJob workerJob = new WorkerJob(getWorkerJobName()); return workerJob; }
private String getString(Object input) { if (input instanceof IStreamContentAccessor) { try { return Utilities.readString((IStreamContentAccessor) input); } catch (CoreException ex) { // NeedWork CompareUIPlugin.log(ex); } } return ""; //$NON-NLS-1$ } }
protected void clearResource() { resource = null; workspaceContent.clearResource(); externalFileContent.clearResource(); externalFolderContent.clearResource(); updateErrorInfo(); }
public OutlineViewerCreator getCreator() { if (fCreator == null) { fCreator = (OutlineViewerCreator)Utilities.getAdapter(fCompareEditor, OutlineViewerCreator.class); if (fCreator != null) fCreator.addPropertyChangeListener(this); } return fCreator; }
/** * Finds the differences between two <code>IRangeComparator</code>s. The * differences are returned as an array of <code>RangeDifference</code>s. * If no differences are detected an empty array is returned. * * @param pm * if not <code>null</code> used to report progress * @param left * the left range comparator * @param right * the right range comparator * @return an array of range differences, or an empty array if no * differences were found * @since 2.0 */ public static RangeDifference[] findDifferences( LCSSettings settings, IRangeComparator left, IRangeComparator right) { if (!settings.isUseGreedyMethod()) { return OldDifferencer.findDifferences( left, right); } return RangeComparatorLCS.findDifferences( settings, left, right); }
/** * Handles the given <code>CoreException</code>. The workbench shell is used as a parent * for the dialog window. * * @param e the <code>CoreException</code> to be handled * @param title the dialog window's window title * @param message message to be displayed by the dialog window */ public static void handle(CoreException e, String title, String message) { handle(e, CompareUIPlugin.getShell(), title, message); }
public ChangePropertyAction(ResourceBundle bundle, CompareConfiguration cc, String rkey, String pkey) { fPropertyKey= pkey; fBundle= bundle; fPrefix= rkey; Utilities.initAction(this, fBundle, fPrefix); setCompareConfiguration(cc); }
protected WorkerJob createWorkerJob() { WorkerJob workerJob = new WorkerJob(getWorkerJobName()); return workerJob; }
org.eclipse.compare.internal.LCSSettings settings = new org.eclipse.compare.internal.LCSSettings();