return findRanges(settings, left, right);
org.eclipse.compare.internal.LCSSettings settings = new org.eclipse.compare.internal.LCSSettings(); RangeDifference[] rd = RangeDifferencer.findRanges(settings, left, right);
/** * Finds the differences among two <code>IRangeComparator</code>s. * In contrast to <code>findDifferences</code>, the result * contains <code>RangeDifference</code> elements for non-differing ranges too. * * @param left the left range comparator * @param right the right range comparator * @return an array of range differences */ public static RangeDifference[] findRanges(IRangeComparator left, IRangeComparator right) { return findRanges((IProgressMonitor)null, left, right); }
/** * Finds the differences among two <code>IRangeComparator</code>s. * In contrast to <code>findDifferences</code>, the result * contains <code>RangeDifference</code> elements for non-differing ranges too. * * @param left the left range comparator * @param right the right range comparator * @return an array of range differences */ public static RangeDifference[] findRanges(IRangeComparator left, IRangeComparator right) { return findRanges((IProgressMonitor) null, left, right); }
/** * Finds the differences among two <code>IRangeComparator</code>s. * In contrast to <code>findDifferences</code>, the result * contains <code>RangeDifference</code> elements for non-differing ranges too. * * @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 * @since 2.0 */ public static RangeDifference[] findRanges(IProgressMonitor pm, IRangeComparator left, IRangeComparator right) { return findRanges(defaultFactory, pm, left, right); }
/** * Finds the differences among two <code>IRangeComparator</code>s. In * contrast to <code>findDifferences</code>, the result contains * <code>RangeDifference</code> elements for non-differing ranges too. * * @param left * the left range comparator * @param right * the right range comparator * @return an array of range differences */ public static RangeDifference[] findRanges(LCSSettings settings, IRangeComparator left, IRangeComparator right) { return findRanges((IProgressMonitor) null, settings, left, right); }
/** * Finds the differences among three <code>IRangeComparator</code>s. * In contrast to <code>findDifferences</code>, the result * contains <code>RangeDifference</code> elements for non-differing ranges too. * If the ancestor range comparator is <code>null</code>, a two-way * comparison is performed. * * @param ancestor the ancestor range comparator or <code>null</code> * @param left the left range comparator * @param right the right range comparator * @return an array of range differences */ public static RangeDifference[] findRanges(IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) { return findRanges(null, ancestor, left, right); }
/** * Finds the differences among three <code>IRangeComparator</code>s. * In contrast to <code>findDifferences</code>, the result * contains <code>RangeDifference</code> elements for non-differing ranges too. * If the ancestor range comparator is <code>null</code>, a two-way * comparison is performed. * * @param ancestor the ancestor range comparator or <code>null</code> * @param left the left range comparator * @param right the right range comparator * @return an array of range differences */ public static RangeDifference[] findRanges(IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) { return findRanges(null, ancestor, left, right); }
/** * Finds the differences among three <code>IRangeComparator</code>s. * In contrast to <code>findDifferences</code>, the result * contains <code>RangeDifference</code> elements for non-differing ranges too. * If the ancestor range comparator is <code>null</code>, a two-way * comparison is performed. * * @param pm if not <code>null</code> used to report progress * @param ancestor the ancestor range comparator or <code>null</code> * @param left the left range comparator * @param right the right range comparator * @return an array of range differences * @since 2.0 */ public static RangeDifference[] findRanges(IProgressMonitor pm, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) { return findRanges(defaultFactory, pm, ancestor, left, right); }
/** * Finds the differences among three <code>IRangeComparator</code>s. In * contrast to <code>findDifferences</code>, the result contains * <code>RangeDifference</code> elements for non-differing ranges too. If * the ancestor range comparator is <code>null</code>, a two-way * comparison is performed. * * @param ancestor * the ancestor range comparator or <code>null</code> * @param left * the left range comparator * @param right * the right range comparator * @return an array of range differences */ public static RangeDifference[] findRanges(LCSSettings settings, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) { return findRanges(null, settings, ancestor, left, right); }
public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException { String progressTitle= Utilities.getString(bundle, "compareProgressTask.title"); //$NON-NLS-1$ monitor.beginTask(progressTitle, maxWork(sa, sl, sr)); try { result[0]= RangeDifferencer.findRanges(monitor, sa, sl, sr); } catch (OutOfMemoryError ex) { System.gc(); throw new InvocationTargetException(ex); } if (monitor.isCanceled()) { // canceled throw new InterruptedException(); } monitor.done(); } };
lineSeparator= "\n"; //$NON-NLS-1$ RangeDifference[] diffs= RangeDifferencer.findRanges(monitor, a, t, o);
lineSeparator= "\n"; //$NON-NLS-1$ RangeDifference[] diffs= RangeDifferencer.findRanges(monitor, a, t, o);
return findRanges(pm, left, right);
Object rightSide= new JavaTokenComparator(currentConentString); RangeDifference[] differences= RangeDifferencer.findRanges((IRangeComparator)leftSide, (IRangeComparator)rightSide); for (int i= 0; i < differences.length; i++) { RangeDifference curr= differences[i];
return findRanges(factory,pm, left, right);
return findRanges(pm, settings, left, right);
private boolean compareStrings(String left, String right, IProgressMonitor monitor) { IDocument lDoc = new Document(left); IDocument rDoc = new Document(right); DocLineComparator sleft = new DocLineComparator(lDoc, new Region(0, lDoc.getLength()), shouldIgnoreWhitespace()); DocLineComparator sright = new DocLineComparator(rDoc, new Region(0, rDoc.getLength()), shouldIgnoreWhitespace()); final DocLineComparator sl = sleft, sr = sright; RangeDifference[] ranges = RangeDifferencer.findRanges(monitor, sl, sr); return compareRangeDifferences(ranges, lDoc, rDoc); } }
ITokenComparator sy= createTokenComparator(s); RangeDifference[] e= RangeDifferencer.findRanges(sa, sy, sm); for (int i= 0; i < e.length; i++) { RangeDifference es= e[i];
ITokenComparator sy= createTokenComparator(s); RangeDifference[] e= RangeDifferencer.findRanges(sa, sy, sm); for (int i= 0; i < e.length; i++) { RangeDifference es= e[i];