001: /*
002: * hgcommons 7
003: * Hammurapi Group Common Library
004: * Copyright (C) 2003 Hammurapi Group
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2 of the License, or (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: *
020: * URL: http://www.hammurapi.biz/hammurapi-biz/ef/xmenu/hammurapi-group/products/products/hgcommons/index.html
021: * e-Mail: support@hammurapi.biz
022: */
023: package biz.hammurapi.legacy.review;
024:
025: import java.io.Serializable;
026:
027: /**
028: * @author Pavel Vlasov
029: * @version $Revision: 1.3 $
030: */
031: public class SimpleSourceMarker implements SourceMarker, Signed,
032: Comparable, Serializable {
033: /**
034: * Comment for <code>serialVersionUID</code>
035: */
036: private static final long serialVersionUID = 8717158207915979L;
037: private int column;
038: private int line;
039: private Integer id;
040:
041: /**
042: * @return Returns the id.
043: */
044: public Integer getSourceId() {
045: return id;
046: }
047:
048: /**
049: * @param id The id to set.
050: */
051: public void setSourceId(Integer id) {
052: this .id = id;
053: }
054:
055: private String sourceURL;
056: private String signature;
057:
058: /**
059: *
060: */
061: public SimpleSourceMarker() {
062: super ();
063: }
064:
065: /**
066: * @return Returns the column.
067: */
068: public int getColumn() {
069: return column;
070: }
071:
072: /**
073: * @param column The column to set.
074: */
075: public void setColumn(int column) {
076: this .column = column;
077: }
078:
079: /**
080: * @return Returns the line.
081: */
082: public int getLine() {
083: return line;
084: }
085:
086: /**
087: * @param line The line to set.
088: */
089: public void setLine(int line) {
090: this .line = line;
091: }
092:
093: /**
094: * @return Returns the sourceURL.
095: */
096: public String getSourceURL() {
097: return sourceURL;
098: }
099:
100: /**
101: * @param sourceURL The sourceURL to set.
102: */
103: public void setSourceURL(String sourceURL) {
104: this .sourceURL = sourceURL;
105: }
106:
107: /**
108: * @param column
109: * @param line
110: * @param sourceURL
111: */
112: public SimpleSourceMarker(int column, int line, String sourceURL,
113: Integer id) {
114: super ();
115: this .column = column;
116: this .line = line;
117: this .sourceURL = sourceURL;
118: this .id = id;
119: }
120:
121: public SimpleSourceMarker(SourceMarker sourceMarker) {
122: this .column = sourceMarker.getColumn();
123: this .line = sourceMarker.getLine();
124: this .sourceURL = sourceMarker.getSourceURL();
125: this .id = sourceMarker.getSourceId();
126:
127: if (sourceMarker instanceof Signed) {
128: this .signature = ((Signed) sourceMarker).getSignature();
129: }
130: }
131:
132: public int compareTo(Object o) {
133: if (o instanceof SourceMarker) {
134: return SourceMarkerComparator._compare(this , o);
135: } else {
136: return 1;
137: }
138: }
139:
140: public String getSignature() {
141: return signature;
142: }
143:
144: public void setSignature(String signature) {
145: this.signature = signature;
146: }
147: }
|