Examples of RangeDifference


Examples of org.eclipse.compare.rangedifferencer.RangeDifference

        rightLength = rightEnd - rightStart;
        ancestorLength = ancestorEnd - ancestorStart;
        i++;
      }

      newRanges.add(new RangeDifference(kind, rightStart, rightLength,
          leftStart, leftLength, ancestorStart, ancestorLength));
    }

    return newRanges;
  }
View Full Code Here

Examples of org.eclipse.compare.rangedifferencer.RangeDifference

              throw new IllegalStateException(
                  "space found aiaiai");
          }
        }
      }
      newRanges.add(new RangeDifference(kind, rightStart, rightEnd
          - rightStart, leftStart, leftEnd - leftStart));
    }

    return newRanges;
  }
View Full Code Here

Examples of org.eclipse.compare.rangedifferencer.RangeDifference

        leftEnd = differences[i + 1].leftEnd();
        rightEnd = differences[i + 1].rightEnd();
        i++;
      }

      newRanges.add(new RangeDifference(kind, rightStart, rightEnd
          - rightStart, leftStart, leftEnd - leftStart));
    }

    return newRanges;
  }
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference

      synchronized (fList) {
        for (ListIterator it= fList.listIterator(); it.hasNext();) {
          if (fDifference.equals(it.next())) {
            if (it.hasNext()) {
              RangeDifference next= (RangeDifference) it.next();
              if (next.rightLength() == 0)
                return Math.max(next.leftLength() - next.rightLength(), 0);
            }
            break;
          }
        }
      }
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference

    if (getChangeType() == UNCHANGED && fOffset == 0) {
      synchronized (fList) {
        for (ListIterator it= fList.listIterator(fList.size()); it.hasPrevious();) {
          if (fDifference.equals(it.previous())) {
            if (it.hasPrevious()) {
              RangeDifference previous= (RangeDifference) it.previous();
              return Math.max(previous.leftLength() - previous.rightLength(), 0);
            }
            break;
          }
        }
      }
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference

   * @param line the line before which the range has to occur
   * @param size the minimal size of the range
   * @return the first range found, or the first range in the differ if none can be found
   */
  private RangeDifference findConsistentRangeBeforeRight(int line, int size) {
    RangeDifference found= null;

    int unchanged= -1; // the number of unchanged lines before line
    for (ListIterator it= fDifferences.listIterator(); it.hasNext();) {
      RangeDifference difference= (RangeDifference) it.next();
      if (found == null)
        found= difference;
      else if (difference.kind() == RangeDifference.NOCHANGE) {
        unchanged= Math.min(line, difference.rightEnd()) - difference.rightStart();
        if (unchanged >= size)
          found= difference;
      }

      if (difference.rightEnd() >= line)
        break;
    }

    return found;
  }
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference

   * @param line the line after which the range has to occur
   * @param size the minimal size of the range
   * @return the first range found, or the last range in the differ if none can be found
   */
  private RangeDifference findConsistentRangeAfterRight(int line, int size) {
    RangeDifference found= null;

    int unchanged= -1; // the number of unchanged lines after line
    for (ListIterator it= fDifferences.listIterator(fDifferences.size()); it.hasPrevious();) {
      RangeDifference difference= (RangeDifference) it.previous();
      if (found == null)
        found= difference;
      else if (difference.kind() == RangeDifference.NOCHANGE) {
        unchanged= difference.rightEnd() - Math.max(line + 1, difference.rightStart()); // + 1 to step over the changed line
        if (unchanged >= size)
          found= difference;
      }

      if (difference.rightStart() <= line)
        break;
    }

    return found;
  }
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference

   *
   * @param rightLine the line on the right side
   * @return the corresponding left hand line, or <code>-1</code>
   */
  private int getLeftLine(int rightLine) {
    RangeDifference d= getRangeDifferenceForRightLine(rightLine);
    if (d == null)
      return -1;
    return Math.min(d.leftEnd() - 1, d.leftStart() + rightLine - d.rightStart());
  }
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference

   *
   * @param leftLine the line on the left side
   * @return the corresponding right hand line, or <code>-1</code>
   */
  private int getRightLine(int leftLine) {
    RangeDifference d= getRangeDifferenceForLeftLine(leftLine);
    if (d == null)
      return -1;
    return Math.min(d.rightEnd() - 1, d.rightStart() + leftLine - d.leftStart());
  }
View Full Code Here

Examples of org.eclipse.ui.internal.texteditor.quickdiff.compare.rangedifferencer.RangeDifference

   * @param leftLine the line on the left side
   * @return the corresponding RangeDifference, or <code>null</code>
   */
  private RangeDifference getRangeDifferenceForLeftLine(int leftLine) {
    for (Iterator it= fDifferences.iterator(); it.hasNext();) {
      RangeDifference d= (RangeDifference) it.next();
      if (leftLine >= d.leftStart() && leftLine < d.leftEnd()) {
        return d;
      }
    }
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.