/** * Construct a new edit representing the region after cut. * * @param cut * the cut point. The ending A and B points are used as the * starting points of the returned edit. * @return an edit representing the slice of {@code this} edit that occurs * after {@code cut} ends. */ public final Edit after(Edit cut) { return new Edit(cut.endA, endA, cut.endB, endB); }
/** * Construct a new edit representing the region before cut. * * @param cut * the cut point. The beginning A and B points are used as the * end points of the returned edit. * @return an edit representing the slice of {@code this} edit that occurs * before {@code cut} starts. */ public final Edit before(Edit cut) { return new Edit(beginA, cut.beginA, beginB, cut.beginB); }
Edit findLongestCommonSequence() { if (!scanA()) return null; lcs = new Edit(0, 0); cnt = maxChainLength + 1; for (int bPtr = region.beginB; bPtr < region.endB;) bPtr = tryLongestCommonSequence(bPtr); return hasCommon && maxChainLength < cnt ? null : lcs; }
private static <S extends Sequence> Edit coverEdit(S a, S b) { return new Edit(0, a.size(), 0, b.size()); }
/** {@inheritDoc} */ @Override public <S extends Sequence> EditList diffNonCommon( SequenceComparator<? super S> cmp, S a, S b) { HashedSequencePair<S> p = new HashedSequencePair<>(cmp, a, b); HashedSequenceComparator<S> hc = p.getComparator(); HashedSequence<S> ha = p.getA(); HashedSequence<S> hb = p.getB(); p = null; EditList res = new EditList(); Edit region = new Edit(0, a.size(), 0, b.size()); diffNonCommon(res, hc, ha, hb, region); return res; }
/** * Construct a new edit representing the region before cut. * * @param cut * the cut point. The beginning A and B points are used as the * end points of the returned edit. * @return an edit representing the slice of {@code this} edit that occurs * before {@code cut} starts. */ public final Edit before(Edit cut) { return new Edit(beginA, cut.beginA, beginB, cut.beginB); }
/** * Construct a new edit representing the region after cut. * * @param cut * the cut point. The ending A and B points are used as the * starting points of the returned edit. * @return an edit representing the slice of {@code this} edit that occurs * after {@code cut} ends. */ public final Edit after(Edit cut) { return new Edit(cut.endA, endA, cut.endB, endB); }
/** * Construct a new edit representing the region before cut. * * @param cut * the cut point. The beginning A and B points are used as the * end points of the returned edit. * @return an edit representing the slice of {@code this} edit that occurs * before {@code cut} starts. */ public final Edit before(Edit cut) { return new Edit(beginA, cut.beginA, beginB, cut.beginB); }
/** * Construct a new edit representing the region after cut. * * @param cut * the cut point. The ending A and B points are used as the * starting points of the returned edit. * @return an edit representing the slice of {@code this} edit that occurs * after {@code cut} ends. */ public final Edit after(Edit cut) { return new Edit(cut.endA, endA, cut.endB, endB); }
Edit findLongestCommonSequence() { if (!scanA()) return null; lcs = new Edit(0, 0); cnt = maxChainLength + 1; for (int bPtr = region.beginB; bPtr < region.endB;) bPtr = tryLongestCommonSequence(bPtr); return hasCommon && maxChainLength < cnt ? null : lcs; }
Edit findLongestCommonSequence() { if (!scanA()) return null; lcs = new Edit(0, 0); cnt = maxChainLength + 1; for (int bPtr = region.beginB; bPtr < region.endB;) bPtr = tryLongestCommonSequence(bPtr); return hasCommon && maxChainLength < cnt ? null : lcs; }
private static <S extends Sequence> Edit coverEdit(S a, S b) { return new Edit(0, a.size(), 0, b.size()); }
private static <S extends Sequence> Edit coverEdit(S a, S b) { return new Edit(0, a.size(), 0, b.size()); }
@Override public <S extends Sequence> EditList diffNonCommon( SequenceComparator<? super S> cmp, S a, S b) { HashedSequencePair<S> p = new HashedSequencePair<S>(cmp, a, b); HashedSequenceComparator<S> hc = p.getComparator(); HashedSequence<S> ha = p.getA(); HashedSequence<S> hb = p.getB(); p = null; EditList res = new EditList(); Edit region = new Edit(0, a.size(), 0, b.size()); diffNonCommon(res, hc, ha, hb, region); return res; }
/** {@inheritDoc} */ @Override public <S extends Sequence> EditList diffNonCommon( SequenceComparator<? super S> cmp, S a, S b) { HashedSequencePair<S> p = new HashedSequencePair<>(cmp, a, b); HashedSequenceComparator<S> hc = p.getComparator(); HashedSequence<S> ha = p.getA(); HashedSequence<S> hb = p.getB(); p = null; EditList res = new EditList(); Edit region = new Edit(0, a.size(), 0, b.size()); diffNonCommon(res, hc, ha, hb, region); return res; }