001: /*
002: * Copyright (C) 2001, 2002 Robert MacGrogan
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2.1 of the License, or (at your option) any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: *
018: *
019: * $Archive: SourceJammer$
020: * $FileName: Hunk3Type.java$
021: * $FileID: 4293$
022: *
023: * Last change:
024: * $AuthorName: Rob MacGrogan$
025: * $Date: 4/23/03 5:23 PM$
026: * $VerID: 8741$
027: * $Comment: Replaced GPL header with LGPL header.$
028: *
029: */
030:
031: package JLibDiff;
032:
033: import org.sourcejammer.util.EnumeratedType;
034:
035: /**
036: * @author $AuthorName: Rob MacGrogan$
037: * @version $VerNum: 2$
038: * $KeyWordsOff: $<br><br>
039: *
040: * Describes the type of difference expressed by a Hunk3 object.
041: */
042: public class Hunk3Type {
043:
044: public static class DifferenceType extends EnumeratedType {
045: private DifferenceType(String val) {
046: setValue(val);
047: }
048: }
049:
050: public static final DifferenceType CHANGE = new DifferenceType(
051: "change");
052: public static final DifferenceType ADD = new DifferenceType("add");
053: public static final DifferenceType REMOVE = new DifferenceType(
054: "remove");
055:
056: public static class InFileType extends EnumeratedType {
057: private InFileType(String val) {
058: setValue(val);
059: }
060: }
061:
062: public static final InFileType FILE_ONE = new InFileType("file one");
063: public static final InFileType FILE_TWO = new InFileType("file two");
064: public static final InFileType BOTH_FILES_SAME = new InFileType(
065: "both files same");
066: public static final InFileType BOTH_FILES_DIFFERENT = new InFileType(
067: "both files different");
068:
069: private InFileType inFileType = null;
070: private DifferenceType differenceType = null;
071:
072: public Hunk3Type() {
073: }
074:
075: /**
076: * Returns the differenceType.
077: * @return DifferenceType
078: */
079: public DifferenceType getDifferenceType() {
080: return differenceType;
081: }
082:
083: /**
084: * Returns the inFileType.
085: * @return InFileType
086: */
087: public InFileType getInFileType() {
088: return inFileType;
089: }
090:
091: /**
092: * Sets the differenceType.
093: * @param differenceType The differenceType to set
094: */
095: public void setDifferenceType(DifferenceType differenceType) {
096: this .differenceType = differenceType;
097: }
098:
099: /**
100: * Sets the inFileType.
101: * @param inFileType The inFileType to set
102: */
103: public void setInFileType(InFileType inFileType) {
104: this .inFileType = inFileType;
105: }
106:
107: public String toString() {
108: return differenceType + "--" + inFileType;
109: }
110:
111: }
|