]>
git.argeo.org Git - gpl/argeo-slc.git/blob - cms/org.argeo.slc.support/src/org/argeo/slc/diff/TableDiffPosition.java
1 package org
.argeo
.slc
.diff
;
3 import org
.argeo
.slc
.UnsupportedException
;
6 * A diff position within a table structure such a CSV file or an SQL result
9 public class TableDiffPosition
extends DiffPosition
{
12 private Integer column
;
14 private String columnName
;
16 public TableDiffPosition(RelatedFile relatedFile
, Integer line
,
17 Integer column
, String columnName
) {
21 this.columnName
= columnName
;
24 @SuppressWarnings("unused")
25 private TableDiffPosition() {
28 public Integer
getLine() {
32 public Integer
getColumn() {
36 public String
getColumnName() {
40 public int compareTo(DiffPosition dp
) {
41 if (!(dp
instanceof TableDiffPosition
))
42 throw new UnsupportedException("position", dp
);
44 TableDiffPosition o
= (TableDiffPosition
) dp
;
45 if (relatedFile
.equals(o
.relatedFile
)) {
47 return column
.compareTo(o
.column
);
49 return line
.compareTo(o
.line
);
52 return relatedFile
.compareTo(o
.relatedFile
);
57 public String
toString() {
58 StringBuffer buf
= new StringBuffer("");
59 buf
.append(relatedFile
).append('[').append(line
);
61 buf
.append(',').append(column
);
62 if (columnName
!= null) {
63 buf
.append('-').append(columnName
);
67 return buf
.toString();
71 @SuppressWarnings("unused")
72 private void setLine(Integer line
) {
76 @SuppressWarnings("unused")
77 private void setColumn(Integer column
) {
81 @SuppressWarnings("unused")
82 private void setColumnName(String columnName
) {
83 this.columnName
= columnName
;