rightStart = changeRangeStart - last.ancestorEnd() + last.rightEnd(); rightEnd = changeRangeEnd - last.ancestorEnd() + last.rightEnd(); kind = RangeDifference.LEFT; } else { leftStart = changeRangeStart - last.ancestorEnd() + last.leftEnd(); leftEnd = changeRangeEnd - last.ancestorEnd() + last.leftEnd(); kind = RangeDifference.RIGHT; } else {
astart = es.ancestorEnd();
rightStart = changeRangeStart - last.ancestorEnd() + last.rightEnd(); rightEnd = changeRangeEnd - last.ancestorEnd() + last.rightEnd(); kind = RangeDifference.LEFT; } else { leftStart = changeRangeStart - last.ancestorEnd() + last.leftEnd(); leftEnd = changeRangeEnd - last.ancestorEnd() + last.leftEnd(); kind = RangeDifference.RIGHT; } else {
rightStart= changeRangeStart - last.ancestorEnd() + last.rightEnd(); rightEnd= changeRangeEnd - last.ancestorEnd() + last.rightEnd(); kind= RangeDifference.LEFT; } else { leftStart= changeRangeStart - last.ancestorEnd() + last.leftEnd(); leftEnd= changeRangeEnd - last.ancestorEnd() + last.leftEnd(); kind= RangeDifference.RIGHT; } else {
rightStart= changeRangeStart - last.ancestorEnd() + last.rightEnd(); rightEnd= changeRangeEnd - last.ancestorEnd() + last.rightEnd(); kind= RangeDifference.LEFT; } else { leftStart= changeRangeStart - last.ancestorEnd() + last.leftEnd(); leftEnd= changeRangeEnd - last.ancestorEnd() + last.leftEnd(); kind= RangeDifference.RIGHT; } else {
rightStart = changeRangeStart - last.ancestorEnd() + last.rightEnd(); rightEnd = changeRangeEnd - last.ancestorEnd() + last.rightEnd(); kind = RangeDifference.LEFT; } else { leftStart = changeRangeStart - last.ancestorEnd() + last.leftEnd(); leftEnd = changeRangeEnd - last.ancestorEnd() + last.leftEnd(); kind = RangeDifference.RIGHT; } else {
private List<RangeDifference> preProcess(RangeDifference[] differences) { List<RangeDifference> newRanges = new LinkedList<RangeDifference>(); for (int i = 0; i < differences.length; i++) { int ancestorStart = differences[i].ancestorStart(); int ancestorEnd = differences[i].ancestorEnd(); int leftStart = differences[i].leftStart(); int leftEnd = differences[i].leftEnd(); int rightStart = differences[i].rightStart(); int rightEnd = differences[i].rightEnd(); int kind = differences[i].kind(); int ancestorLength = ancestorEnd - ancestorStart; int leftLength = leftEnd - leftStart; int rightLength = rightEnd - rightStart; while (i + 1 < differences.length && differences[i + 1].kind() == kind && score(leftLength, differences[i + 1].leftLength(), rightLength, differences[i + 1].rightLength()) > (differences[i + 1] .leftStart() - leftEnd)) { leftEnd = differences[i + 1].leftEnd(); rightEnd = differences[i + 1].rightEnd(); ancestorEnd = differences[i + 1].ancestorEnd(); leftLength = leftEnd - leftStart; rightLength = rightEnd - rightStart; ancestorLength = ancestorEnd - ancestorStart; i++; } newRanges.add(new RangeDifference(kind, rightStart, rightLength, leftStart, leftLength, ancestorStart, ancestorLength)); } return newRanges; }
astart= es.ancestorEnd();
astart= es.ancestorEnd();
astart = es.ancestorEnd();
astart = es.ancestorEnd();
leftComparator, d.ancestorStart(), d.ancestorEnd(), ModificationType.ADDED); rightComparator, d.ancestorStart(), d.ancestorEnd(), ModificationType.ADDED); ancestorComparator.markAsNew(d.ancestorStart(), d.ancestorEnd(), ModificationType.REMOVED); currentIndexAncestor = d.ancestorEnd(); currentIndexLeft = d.leftEnd(); currentIndexRight = d.rightEnd();