-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.diff;\r
-\r
-import org.argeo.slc.UnsupportedException;\r
-\r
-/**\r
- * A diff position within a table structure such a CSV file or an SQL result\r
- * set.\r
- */\r
-public class TableDiffPosition extends DiffPosition {\r
- private Integer line;\r
- /** Can be null */\r
- private Integer column;\r
- /** Can be null */\r
- private String columnName;\r
-\r
- public TableDiffPosition(RelatedFile relatedFile, Integer line,\r
- Integer column, String columnName) {\r
- super(relatedFile);\r
- this.line = line;\r
- this.column = column;\r
- this.columnName = columnName;\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private TableDiffPosition() {\r
- }\r
-\r
- public Integer getLine() {\r
- return line;\r
- }\r
-\r
- public Integer getColumn() {\r
- return column;\r
- }\r
-\r
- public String getColumnName() {\r
- return columnName;\r
- }\r
-\r
- public int compareTo(DiffPosition dp) {\r
- if (!(dp instanceof TableDiffPosition))\r
- throw new UnsupportedException("position", dp);\r
-\r
- TableDiffPosition o = (TableDiffPosition) dp;\r
- if (relatedFile.equals(o.relatedFile)) {\r
- if (line == o.line) {\r
- return column.compareTo(o.column);\r
- } else {\r
- return line.compareTo(o.line);\r
- }\r
- } else {\r
- return relatedFile.compareTo(o.relatedFile);\r
- }\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- StringBuffer buf = new StringBuffer("");\r
- buf.append(relatedFile).append('[').append(line);\r
- if (column != null) {\r
- buf.append(',').append(column);\r
- if (columnName != null) {\r
- buf.append('-').append(columnName);\r
- }\r
- }\r
- buf.append(']');\r
- return buf.toString();\r
- }\r
-\r
- // Hibernate\r
- @SuppressWarnings("unused")\r
- private void setLine(Integer line) {\r
- this.line = line;\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private void setColumn(Integer column) {\r
- this.column = column;\r
- }\r
-\r
- @SuppressWarnings("unused")\r
- private void setColumnName(String columnName) {\r
- this.columnName = columnName;\r
- }\r
-\r
-}\r
+package org.argeo.slc.diff;
+
+import org.argeo.slc.UnsupportedException;
+
+/**
+ * A diff position within a table structure such a CSV file or an SQL result
+ * set.
+ */
+public class TableDiffPosition extends DiffPosition {
+ private Integer line;
+ /** Can be null */
+ private Integer column;
+ /** Can be null */
+ private String columnName;
+
+ public TableDiffPosition(RelatedFile relatedFile, Integer line,
+ Integer column, String columnName) {
+ super(relatedFile);
+ this.line = line;
+ this.column = column;
+ this.columnName = columnName;
+ }
+
+ @SuppressWarnings("unused")
+ private TableDiffPosition() {
+ }
+
+ public Integer getLine() {
+ return line;
+ }
+
+ public Integer getColumn() {
+ return column;
+ }
+
+ public String getColumnName() {
+ return columnName;
+ }
+
+ public int compareTo(DiffPosition dp) {
+ if (!(dp instanceof TableDiffPosition))
+ throw new UnsupportedException("position", dp);
+
+ TableDiffPosition o = (TableDiffPosition) dp;
+ if (relatedFile.equals(o.relatedFile)) {
+ if (line == o.line) {
+ return column.compareTo(o.column);
+ } else {
+ return line.compareTo(o.line);
+ }
+ } else {
+ return relatedFile.compareTo(o.relatedFile);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer buf = new StringBuffer("");
+ buf.append(relatedFile).append('[').append(line);
+ if (column != null) {
+ buf.append(',').append(column);
+ if (columnName != null) {
+ buf.append('-').append(columnName);
+ }
+ }
+ buf.append(']');
+ return buf.toString();
+ }
+
+ // Hibernate
+ @SuppressWarnings("unused")
+ private void setLine(Integer line) {
+ this.line = line;
+ }
+
+ @SuppressWarnings("unused")
+ private void setColumn(Integer column) {
+ this.column = column;
+ }
+
+ @SuppressWarnings("unused")
+ private void setColumnName(String columnName) {
+ this.columnName = columnName;
+ }
+
+}