|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.api.diff; import java.io.Serializable; /** * This class represents a single difference between two files. * * @author Martin Entlicher */ public class Difference extends Object implements Serializable { /** Delete type of difference - a portion of a file was removed in the other */ public static final int DELETE = 0; /** Add type of difference - a portion of a file was added in the other */ public static final int ADD = 1; /** Change type of difference - a portion of a file was changed in the other */ public static final int CHANGE = 2; private int type = 0; private int firstStart = 0; private int firstEnd = 0; private int secondStart = 0; private int secondEnd = 0; private Difference.Part[] firstLineDiffs; private Difference.Part[] secondLineDiffs; /** The text of the difference in the first file. */ private String firstText; /** The text of the difference in the second file. */ private String secondText; private static final long serialVersionUID = 7638201981188907148L; /** * Creates a new instance of Difference * @param type The type of the difference. Must be one of the DELETE, * ADD or CHANGE * @param firstStart The line number on which the difference starts in the first file. * @param firstEnd The line number on which the difference ends in the first file. * @param secondStart The line number on which the difference starts in the second file. * @param secondEnd The line number on which the difference ends in the second file. */ public Difference(int type, int firstStart, int firstEnd, int secondStart, int secondEnd) { this(type, firstStart, firstEnd, secondStart, secondEnd, null, null, null, null); } /** * Creates a new instance of Difference * @param type The type of the difference. Must be one of the DELETE, * ADD or CHANGE * @param firstStart The line number on which the difference starts in the first file. * @param firstEnd The line number on which the difference ends in the first file. * @param secondStart The line number on which the difference starts in the second file. * @param secondEnd The line number on which the difference ends in the second file. * @param firstText The text content of the difference in the first file. * @param secondText The text content of the difference in the second file. */ public Difference(int type, int firstStart, int firstEnd, int secondStart, int secondEnd, String firstText, String secondText) { this(type, firstStart, firstEnd, secondStart, secondEnd, firstText, secondText, null, null); } /** * Creates a new instance of Difference * @param type The type of the difference. Must be one of the DELETE, * ADD or CHANGE * @param firstStart The line number on which the difference starts in the first file. * @param firstEnd The line number on which the difference ends in the first file. * @param secondStart The line number on which the difference starts in the second file. * @param secondEnd The line number on which the difference ends in the second file. * @param firstText The text content of the difference in the first file. * @param secondText The text content of the difference in the second file. * @param firstLineDiffs The list of differences on lines in the first file. * The list contains instances of {@link Difference.Part}. * Can be |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.