Home | History | Annotate | Download | only in plaintext

Lines Matching refs:text2

134    * @param text2 New string to be diffed.
137 public LinkedList<Diff> diff_main(String text1, String text2) {
138 return diff_main(text1, text2, true);
145 * @param text2 New string to be diffed.
151 public LinkedList<Diff> diff_main(String text1, String text2,
154 if (text1 == null || text2 == null) {
160 if (text1.equals(text2)) {
167 int commonlength = diff_commonPrefix(text1, text2);
170 text2 = text2.substring(commonlength);
173 commonlength = diff_commonSuffix(text1, text2);
176 text2 = text2.substring(0, text2.length() - commonlength);
179 diffs = diff_compute(text1, text2, checklines);
198 * @param text2 New string to be diffed.
204 protected LinkedList<Diff> diff_compute(String text1, String text2,
210 diffs.add(new Diff(Operation.INSERT, text2));
214 if (text2.length() == 0) {
220 String longtext = text1.length() > text2.length() ? text1 : text2;
221 String shorttext = text1.length() > text2.length() ? text2 : text1;
225 Operation op = (text1.length() > text2.length()) ?
235 String[] hm = diff_halfMatch(text1, text2);
254 if (checklines && (text1.length() < 100 || text2.length() < 100)) {
260 LinesToCharsResult b = diff_linesToChars(text1, text2);
262 text2 = b.chars2;
266 diffs = diff_map(text1, text2);
271 diffs.add(new Diff(Operation.INSERT, text2));
330 * @param text2 Second string.
331 * @return An object containing the encoded text1, the encoded text2 and
335 protected LinesToCharsResult diff_linesToChars(String text1, String text2) {
346 String chars2 = diff_linesToCharsMunge(text2, lineArray, lineHash);
410 * @param text2 New string to be diffed.
413 protected LinkedList<Diff> diff_map(String text1, String text2) {
417 int text2_length = text2.length();
458 && text1.charAt(x) == text2.charAt(y)) {
475 return diff_path1(v_map1, text1, text2);
480 text2.substring(0, y));
481 a.addAll(diff_path2(v_map2, text1.substring(x), text2.substring(y)));
505 == text2.charAt(text2_length - y - 1)) {
523 text2.substring(0, text2_length - y));
525 text2.substring(text2_length - y)));
540 * @param text2 New string fragment to be diffed.
544 String text1, String text2) {
547 int y = text2.length();
564 path.getFirst().text = text2.charAt(y) + path.getFirst().text;
567 text2.substring(y, y + 1)));
574 assert (text1.charAt(x) == text2.charAt(y))
593 * @param text2 New string fragment to be diffed.
597 String text1, String text2) {
600 int y = text2.length();
617 path.getLast().text += text2.charAt(text2.length() - y - 1);
620 text2.substring(text2.length() - y - 1, text2.length() - y)));
628 == text2.charAt(text2.length() - y - 1))
664 * @param text2 Second string.
667 public int diff_commonPrefix(String text1, String text2) {
669 int n = Math.min(text1.length(), text2.length());
671 if (text1.charAt(i) != text2.charAt(i)) {
682 * @param text2 Second string.
685 public int diff_commonSuffix(String text1, String text2) {
688 int text2_length = text2.length();
691 if (text1.charAt(text1_length - i) != text2.charAt(text2_length - i)) {
703 * @param text2 Second string.
705 * suffix of text1, the prefix of text2, the suffix of text2 and the
708 protected String[] diff_halfMatch(String text1, String text2) {
709 String longtext = text1.length() > text2.length() ? text1 : text2;
710 String shorttext = text1.length() > text2.length() ? text2 : text1;
734 if (text1.length() > text2.length()) {
1255 * text2.
1259 * @return Location within text2.
1391 * required to transform text1 into text2.
1430 * operations required to transform text1 into text2, compute the full diff.
1735 * Compute a list of patches to turn text1 into text2.
1738 * @param text2 New text.
1741 public LinkedList<Patch> patch_make(String text1, String text2) {
1742 if (text1 == null || text2 == null) {
1746 LinkedList<Diff> diffs = diff_main(text1, text2, true);
1756 * Compute a list of patches to turn text1 into text2.
1758 * @param diffs Array of diff tuples for text1 to text2.
1772 * Compute a list of patches to turn text1 into text2.
1773 * text2 is ignored, diffs are the delta between text1 and text2.
1775 * @param text2 Ignored.
1776 * @param diffs Array of diff tuples for text1 to text2.
1780 public LinkedList<Patch> patch_make(String text1, String text2,
1787 * Compute a list of patches to turn text1 into text2.
1788 * text2 is not provided, diffs are the delta between text1 and text2.
1790 * @param diffs Array of diff tuples for text1 to text2.
1804 int char_count2 = 0; // Number of characters into the text2 string.
1806 // text2 (postpatch_text). We recreate the patches one by one to determine
1955 String text2;
1957 text2 = text.substring(start_loc,
1960 text2 = text.substring(start_loc,
1963 if (text1.equals(text2)) {
1970 LinkedList<Diff> diffs = diff_main(text1, text2, false);