Statistics
| Revision:

root / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / fmap / data / feature / swing / table / SetFeatureValueException.java @ 23697

History | View | Annotate | Download (3.41 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Gobernment (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22

    
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 {DiSiD Technologies}  {{Task}}
26
 */
27
package org.gvsig.fmap.data.feature.swing.table;
28

    
29
import java.util.HashMap;
30
import java.util.Map;
31

    
32
import org.gvsig.tools.exception.BaseRuntimeException;
33

    
34
/**
35
 * 
36
 * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
37
 */
38
public class SetFeatureValueException extends BaseRuntimeException {
39

    
40
    private static final String KEY = "set_feature_value_exception";
41

    
42
    private static final String MESSAGE = "Error setting the value of the cell "
43
            + "at row =  %(rowIndex) and column = %(columnIndex) "
44
            + "with the value = %(value)";
45

    
46
    private static final long serialVersionUID = -414675652211552543L;
47

    
48
    private int rowIndex;
49

    
50
    private int columnIndex;
51

    
52
    private Object value;
53

    
54
    /**
55
     * Creates a new Exception when setting a Feature value.
56
     * 
57
     * @param rowIndex
58
     *            the position of the Feature
59
     * @param columnIndex
60
     *            the position of the value into the Feature
61
     * @param value
62
     *            the value to set
63
     */
64
    public SetFeatureValueException(int rowIndex, int columnIndex, Object value) {
65
        super(MESSAGE, KEY, serialVersionUID);
66
        this.rowIndex = rowIndex;
67
        this.columnIndex = columnIndex;
68
        this.value = value;
69
    }
70

    
71
    /**
72
     * Creates a new Exception when setting a Feature value.
73
     * 
74
     * @param rowIndex
75
     *            the position of the Feature
76
     * @param columnIndex
77
     *            the position of the value into the Feature
78
     * @param value
79
     *            the value to set
80
     * @param cause
81
     *            the original Throwable
82
     */
83
    public SetFeatureValueException(int rowIndex, int columnIndex,
84
            Object value, Throwable cause) {
85
        super(MESSAGE, cause, KEY, serialVersionUID);
86
        this.rowIndex = rowIndex;
87
        this.columnIndex = columnIndex;
88
        this.value = value;
89
    }
90

    
91
    /**
92
     * @return the rowIndex
93
     */
94
    public int getRowIndex() {
95
        return rowIndex;
96
    }
97

    
98
    /**
99
     * @return the columnIndex
100
     */
101
    public int getColumnIndex() {
102
        return columnIndex;
103
    }
104

    
105
    /**
106
     * @return the value
107
     */
108
    public Object getValue() {
109
        return value;
110
    }
111

    
112
    @SuppressWarnings("unchecked")
113
    @Override
114
    protected Map values() {
115
        Map values = new HashMap(3);
116
        values.put("rowIndex", getRowIndex());
117
        values.put("columnIndex", getColumnIndex());
118
        values.put("value", getValue());
119
        return values;
120
    }
121

    
122
}