Revision 22976

View differences:

trunk/extensions/extNormalization/src/org/gvsig/patterns/normalization/Stringvalue.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (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 Prodevelop S.L. main development
26
 */
27

  
28
package org.gvsig.patterns.normalization;
29

  
30
/**
31
 * 
32
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
33
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
34
 * 
35
 */
36

  
37
import org.gvsig.tools.storage.IStorable;
38
import org.gvsig.tools.storage.IStorage;
39

  
40
/**
41
 * Class Stringvalue.
42
 * 
43
 * @version $Revision$ $Date$
44
 */
45
public class Stringvalue implements IStorable {
46

  
47
	// --------------------------/
48
	// - Class/Member Variables -/
49
	// --------------------------/
50

  
51
	/**
52
	 * Field _stringvaluewidth
53
	 */
54
	private int _stringvaluewidth;
55

  
56
	// ----------------/
57
	// - Constructors -/
58
	// ----------------/
59

  
60
	public Stringvalue() {
61
		super();
62
	}
63

  
64
	// -----------/
65
	// - Methods -/
66
	// -----------/
67

  
68
	/**
69
	 * Returns the value of field 'stringvaluewidth'.
70
	 * 
71
	 * @return the value of field 'stringvaluewidth'.
72
	 */
73
	public int getStringvaluewidth() {
74
		return this._stringvaluewidth;
75
	}
76

  
77
	/**
78
	 * Sets the value of field 'stringvaluewidth'.
79
	 * 
80
	 * @param stringvaluewidth
81
	 *            the value of field 'stringvaluewidth'
82
	 */
83
	public void setStringvaluewidth(int stringvaluewidth) {
84
		this._stringvaluewidth = stringvaluewidth;
85
	}
86

  
87
	public void getstate(IStorage state) {
88
		state.setTheClass(this);
89
		state.put("stringvaluewidth", this._stringvaluewidth);
90

  
91
	}
92

  
93
	public void setstate(IStorage state) {
94
		this._stringvaluewidth = state.getInt("stringvaluewidth");
95

  
96
	}
97

  
98
}
trunk/extensions/extNormalization/src/org/gvsig/patterns/normalization/Fieldseparator.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (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 Prodevelop S.L. main development
26
 */
27

  
28
package org.gvsig.patterns.normalization;
29

  
30
import org.gvsig.tools.storage.IStorable;
31
import org.gvsig.tools.storage.IStorage;
32

  
33
/**
34
 * 
35
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
36
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
37
 * 
38
 */
39

  
40
/**
41
 * Class Fieldseparator.
42
 * 
43
 * @version $Revision$ $Date$
44
 */
45
public class Fieldseparator implements IStorable {
46

  
47
	// --------------------------/
48
	// - Class/Member Variables -/
49
	// --------------------------/
50

  
51
	/**
52
	 * Field _tabsep
53
	 */
54
	private boolean _tabsep;
55

  
56
	/**
57
	 * Field _spacesep
58
	 */
59
	private boolean _spacesep;
60

  
61
	/**
62
	 * Field _colonsep
63
	 */
64
	private boolean _colonsep;
65

  
66
	/**
67
	 * Field _semicolonsep
68
	 */
69
	private boolean _semicolonsep;
70

  
71
	/**
72
	 * Field _othersep
73
	 */
74
	private String _othersep;
75

  
76
	/**
77
	 * Field _joinsep
78
	 */
79
	private boolean _joinsep;
80

  
81
	// ----------------/
82
	// - Constructors -/
83
	// ----------------/
84

  
85
	public Fieldseparator() {
86
		super();
87
	}
88

  
89
	// -----------/
90
	// - Methods -/
91
	// -----------/
92

  
93
	/**
94
	 * Returns the value of field 'colonsep'.
95
	 * 
96
	 * @return the value of field 'colonsep'.
97
	 */
98
	public boolean getColonsep() {
99
		return this._colonsep;
100
	}
101

  
102
	/**
103
	 * Returns the value of field 'joinsep'.
104
	 * 
105
	 * @return the value of field 'joinsep'.
106
	 */
107
	public boolean getJoinsep() {
108
		return this._joinsep;
109
	}
110

  
111
	/**
112
	 * Returns the value of field 'othersep'.
113
	 * 
114
	 * @return the value of field 'othersep'.
115
	 */
116
	public java.lang.String getOthersep() {
117
		return this._othersep;
118
	}
119

  
120
	/**
121
	 * Returns the value of field 'semicolonsep'.
122
	 * 
123
	 * @return the value of field 'semicolonsep'.
124
	 */
125
	public boolean getSemicolonsep() {
126
		return this._semicolonsep;
127
	}
128

  
129
	/**
130
	 * Returns the value of field 'spacesep'.
131
	 * 
132
	 * @return the value of field 'spacesep'.
133
	 */
134
	public boolean getSpacesep() {
135
		return this._spacesep;
136
	}
137

  
138
	/**
139
	 * Returns the value of field 'tabsep'.
140
	 * 
141
	 * @return the value of field 'tabsep'.
142
	 */
143
	public boolean getTabsep() {
144
		return this._tabsep;
145
	}
146

  
147
	/**
148
	 * Sets the value of field 'colonsep'.
149
	 * 
150
	 * @param colonsep
151
	 *            the value of field 'colonsep'.
152
	 */
153
	public void setColonsep(boolean colonsep) {
154
		this._colonsep = colonsep;
155
	}
156

  
157
	/**
158
	 * Sets the value of field 'joinsep'.
159
	 * 
160
	 * @param joinsep
161
	 *            the value of field 'joinsep'.
162
	 */
163
	public void setJoinsep(boolean joinsep) {
164
		this._joinsep = joinsep;
165
	}
166

  
167
	/**
168
	 * Sets the value of field 'othersep'.
169
	 * 
170
	 * @param othersep
171
	 *            the value of field 'othersep'.
172
	 */
173
	public void setOthersep(java.lang.String othersep) {
174
		this._othersep = othersep;
175
	}
176

  
177
	/**
178
	 * Sets the value of field 'semicolonsep'.
179
	 * 
180
	 * @param semicolonsep
181
	 *            the value of field 'semicolonsep'.
182
	 */
183
	public void setSemicolonsep(boolean semicolonsep) {
184
		this._semicolonsep = semicolonsep;
185
	}
186

  
187
	/**
188
	 * Sets the value of field 'spacesep'.
189
	 * 
190
	 * @param spacesep
191
	 *            the value of field 'spacesep'.
192
	 */
193
	public void setSpacesep(boolean spacesep) {
194
		this._spacesep = spacesep;
195
	}
196

  
197
	/**
198
	 * Sets the value of field 'tabsep'.
199
	 * 
200
	 * @param tabsep
201
	 *            the value of field 'tabsep'.
202
	 */
203
	public void setTabsep(boolean tabsep) {
204
		this._tabsep = tabsep;
205
	}
206

  
207
	public void getstate(IStorage state) {
208
		state.setTheClass(this);
209
		state.put("tabsep", this._tabsep ? "true" : "false");
210
		state.put("spacesep", this._spacesep ? "true" : "false");
211
		state.put("colonsep", this._colonsep ? "true" : "false");
212
		state.put("semicolonsep", this._semicolonsep ? "true" : "false");
213
		state.put("othersep", (String) this._othersep);
214
		state.put("joinsep", this._joinsep ? "true" : "false");
215

  
216
	}
217

  
218
	public void setstate(IStorage state) {
219
		this._tabsep = ((String) state.get("tabsep")).compareTo("true") == 0 ? true
220
				: false;
221
		this._spacesep = ((String) state.get("spacesep")).compareTo("true") == 0 ? true
222
				: false;
223
		this._colonsep = ((String) state.get("colonsep")).compareTo("true") == 0 ? true
224
				: false;
225
		this._semicolonsep = ((String) state.get("semicolonsep"))
226
				.compareTo("true") == 0 ? true : false;
227
		this._othersep = (String) state.get("othersep");
228
		this._joinsep = ((String) state.get("joinsep")).compareTo("true") == 0 ? true
229
				: false;
230

  
231
	}
232
}
trunk/extensions/extNormalization/src/org/gvsig/patterns/normalization/Patternnormalization.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (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 Prodevelop S.L. main development
26
 */
27

  
28
package org.gvsig.patterns.normalization;
29

  
30
/**
31
 * 
32
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
33
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
34
 * 
35
 */
36

  
37
import java.util.ArrayList;
38
import java.util.List;
39

  
40
import org.gvsig.tools.storage.IStorable;
41
import org.gvsig.tools.storage.IStorage;
42
import org.gvsig.tools.storage.StorageCollection;
43

  
44
/**
45
 * Class Patternnormalization.
46
 * 
47
 * @version $Revision$ $Date$
48
 */
49
public class Patternnormalization implements IStorable {
50

  
51
	// --------------------------/
52
	// - Class/Member Variables -/
53
	// --------------------------/
54

  
55
	/**
56
	 * Field _patternname
57
	 */
58
	private String _patternname;
59

  
60
	/**
61
	 * Field _patternurl
62
	 */
63
	private String _patternurl;
64

  
65
	/**
66
	 * Field _nofirstrows
67
	 */
68
	private int _nofirstrows;
69

  
70
	/**
71
	 * Field _elements
72
	 */
73
	private List _elements;
74

  
75
	// ----------------/
76
	// - Constructors -/
77
	// ----------------/
78

  
79
	public Patternnormalization() {
80
		super();
81
	}
82

  
83
	// -----------/
84
	// - Methods -/
85
	// -----------/
86

  
87
	/**
88
	 * Returns the value of field 'elements'.
89
	 * 
90
	 * @return the value of field 'elements'.
91
	 */
92
	public List getElements() {
93
		return this._elements;
94
	}
95
	
96
	/**
97
	 * Returns the value of field 'elements'.
98
	 * 
99
	 * @return the value of field 'elements'.
100
	 */
101
	public Element[] getArrayElements() {
102
		Element[] eles = new Element [this._elements.size()];
103
		for (int i = 0; i < this._elements.size(); i++) {
104
			eles[i]=(Element)this._elements.get(i);
105
		}
106
		return eles;
107
	}
108

  
109
	/**
110
	 * Returns the value of field 'nofirstrows'.
111
	 * 
112
	 * @return the value of field 'nofirstrows'.
113
	 */
114
	public int getNofirstrows() {
115
		return this._nofirstrows;
116
	}
117

  
118
	/**
119
	 * Returns the value of field 'patternname'.
120
	 * 
121
	 * @return the value of field 'patternname'.
122
	 */
123
	public java.lang.String getPatternname() {
124
		return this._patternname;
125
	}
126

  
127
	/**
128
	 * Returns the value of field 'patternurl'.
129
	 * 
130
	 * @return the value of field 'patternurl'.
131
	 */
132
	public java.lang.String getPatternurl() {
133
		return this._patternurl;
134
	}
135

  
136
	/**
137
	 * Sets the value of field 'elements'.
138
	 * 
139
	 * @param elements
140
	 *            the value of field 'elements'.
141
	 */
142
	public void setElements(List elements) {
143
		this._elements = elements;
144
	}
145

  
146
	/**
147
	 * Sets the value of field 'nofirstrows'.
148
	 * 
149
	 * @param nofirstrows
150
	 *            the value of field 'nofirstrows'.
151
	 */
152
	public void setNofirstrows(int nofirstrows) {
153
		this._nofirstrows = nofirstrows;
154
	}
155

  
156
	/**
157
	 * Sets the value of field 'patternname'.
158
	 * 
159
	 * @param patternname
160
	 *            the value of field 'patternname'.
161
	 */
162
	public void setPatternname(String patternname) {
163
		this._patternname = patternname;
164
	}
165

  
166
	/**
167
	 * Sets the value of field 'patternurl'.
168
	 * 
169
	 * @param patternurl
170
	 *            the value of field 'patternurl'.
171
	 */
172
	public void setPatternurl(String patternurl) {
173
		this._patternurl = patternurl;
174
	}
175

  
176
	public void getstate(IStorage state) {
177
		state.setName("patternnormalization");
178
		state.setTheClass(this);
179
		state.put("patternname", this._patternname);
180
		state.put("patternurl", this._patternurl);
181
		state.put("nofirstrows", this._nofirstrows);
182
		state.put("elements","element", this._elements);
183
	}
184

  
185
	public void setstate(IStorage state) {
186
		this._patternname = ((String) state.get("patternname")).trim();
187
		this._patternurl = ((String) state.get("patternurl")).trim();
188
		this._nofirstrows = state.getInt("nofirstrows");
189
		try {
190
			StorageCollection sto = (StorageCollection) state
191
					.getObject("elements");
192
			this._elements = new ArrayList();
193
			for (int i = 0; i < sto.size(); i++) {
194
				Element elem = (Element)  sto.get(i);
195
				this._elements.add(elem);
196

  
197
			}
198
		} catch (InstantiationException e) {
199
			// TODO Auto-generated catch block
200
			e.printStackTrace();
201
		} catch (IllegalAccessException e) {
202
			// TODO Auto-generated catch block
203
			e.printStackTrace();
204
		}
205
	}
206

  
207
}
trunk/extensions/extNormalization/src/org/gvsig/patterns/normalization/Fieldtype.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (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 Prodevelop S.L. main development
26
 */
27

  
28
package org.gvsig.patterns.normalization;
29

  
30
/**
31
 * 
32
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
33
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
34
 * 
35
 */
36

  
37
import org.gvsig.tools.storage.IStorable;
38
import org.gvsig.tools.storage.IStorage;
39

  
40
/**
41
 * Class Fieldtype.
42
 * 
43
 * @version $Revision$ $Date$
44
 */
45
public class Fieldtype implements IStorable {
46

  
47
	// --------------------------/
48
	// - Class/Member Variables -/
49
	// --------------------------/
50

  
51
	/**
52
	 * Field _stringvalue
53
	 */
54
	private Stringvalue _stringvalue;
55

  
56
	/**
57
	 * Field _datevalue
58
	 */
59
	private Datevalue _datevalue;
60

  
61
	/**
62
	 * Field _decimalvalue
63
	 */
64
	private Decimalvalue _decimalvalue;
65

  
66
	/**
67
	 * Field _integervalue
68
	 */
69
	private Integervalue _integervalue;
70

  
71
	// ----------------/
72
	// - Constructors -/
73
	// ----------------/
74

  
75
	public Fieldtype() {
76
		super();
77
	}
78

  
79
	// -----------/
80
	// - Methods -/
81
	// -----------/
82

  
83
	/**
84
	 * Returns the value of field 'datevalue'.
85
	 * 
86
	 * @return the value of field 'datevalue'.
87
	 */
88
	public Datevalue getDatevalue() {
89
		return this._datevalue;
90
	}
91

  
92
	/**
93
	 * Returns the value of field 'decimalvalue'.
94
	 * 
95
	 * @return the value of field 'decimalvalue'.
96
	 */
97
	public Decimalvalue getDecimalvalue() {
98
		return this._decimalvalue;
99
	}
100

  
101
	/**
102
	 * Returns the value of field 'integervalue'.
103
	 * 
104
	 * @return the value of field 'integervalue'.
105
	 */
106
	public Integervalue getIntegervalue() {
107
		return this._integervalue;
108
	}
109

  
110
	/**
111
	 * Returns the value of field 'stringvalue'.
112
	 * 
113
	 * @return the value of field 'stringvalue'.
114
	 */
115
	public Stringvalue getStringvalue() {
116
		return this._stringvalue;
117
	}
118

  
119
	/**
120
	 * Sets the value of field 'datevalue'.
121
	 * 
122
	 * @param datevalue
123
	 *            the value of field 'datevalue'.
124
	 */
125
	public void setDatevalue(Datevalue datevalue) {
126
		this._datevalue = datevalue;
127
	}
128

  
129
	/**
130
	 * Sets the value of field 'decimalvalue'.
131
	 * 
132
	 * @param decimalvalue
133
	 *            the value of field 'decimalvalue'.
134
	 */
135
	public void setDecimalvalue(Decimalvalue decimalvalue) {
136
		this._decimalvalue = decimalvalue;
137
	}
138

  
139
	/**
140
	 * Sets the value of field 'integervalue'.
141
	 * 
142
	 * @param integervalue
143
	 *            the value of field 'integervalue'.
144
	 */
145
	public void setIntegervalue(Integervalue integervalue) {
146
		this._integervalue = integervalue;
147
	}
148

  
149
	/**
150
	 * Sets the value of field 'stringvalue'.
151
	 * 
152
	 * @param stringvalue
153
	 *            the value of field 'stringvalue'.
154
	 */
155
	public void setStringvalue(Stringvalue stringvalue) {
156
		this._stringvalue = stringvalue;
157
	}
158

  
159
	public void getstate(IStorage state) {
160
		state.setTheClass(this);
161
		if (this._stringvalue != null) {
162
			state.put("stringvalue", this._stringvalue);
163
		}
164
		else if (this._datevalue != null) {
165
			state.put("datevalue", this._datevalue);
166
		}
167
		else if (this._decimalvalue != null){
168
			state.put("decimalvalue", this._decimalvalue);
169
		}
170
		else{
171
			state.put("integervalue", this._integervalue);
172
		}		
173
	}
174

  
175
	public void setstate(IStorage state) {
176
		try {
177
			if (state.getObject("stringvalue") != null) {
178
				this._stringvalue = (Stringvalue) state.getObject("stringvalue");
179
			}
180
			else if (state.getObject("datevalue") != null) {
181
				this._datevalue = (Datevalue) state.getObject("datevalue");
182
			}
183
			else if (state.getObject("decimalvalue") != null) {
184
				this._decimalvalue = (Decimalvalue) state.getObject("decimalvalue");
185
			}
186
			else {
187
				this._integervalue = (Integervalue) state.getObject("integervalue");
188
			}
189
		} catch (InstantiationException e) {
190
			// TODO Auto-generated catch block
191
			e.printStackTrace();
192
		} catch (IllegalAccessException e) {
193
			// TODO Auto-generated catch block
194
			e.printStackTrace();
195
		}		
196
	}
197

  
198
}
trunk/extensions/extNormalization/src/org/gvsig/patterns/normalization/Element.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (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 Prodevelop S.L. main development
26
 */
27
package org.gvsig.patterns.normalization;
28

  
29
/**
30
 * 
31
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
32
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
33
 * 
34
 */
35

  
36
import org.gvsig.tools.storage.IStorable;
37
import org.gvsig.tools.storage.IStorage;
38

  
39
/**
40
 * Class Element.
41
 * 
42
 * @version $Revision$ $Date$
43
 */
44
public class Element implements IStorable {
45

  
46
	// --------------------------/
47
	// - Class/Member Variables -/
48
	// --------------------------/
49

  
50
	/**
51
	 * Field _fieldname
52
	 */
53
	private String _fieldname;
54

  
55
	/**
56
	 * Field _fieldtype
57
	 */
58
	private Fieldtype _fieldtype;
59

  
60
	/**
61
	 * Field _fieldwidth
62
	 */
63
	private int _fieldwidth;
64

  
65
	/**
66
	 * Field _fieldseparator
67
	 */
68
	private Fieldseparator _fieldseparator;
69

  
70
	/**
71
	 * Field _infieldseparators
72
	 */
73
	private Infieldseparators _infieldseparators;
74

  
75
	/**
76
	 * Field _importfield
77
	 */
78
	private boolean _importfield;
79

  
80
	// ----------------/
81
	// - Constructors -/
82
	// ----------------/
83

  
84
	public Element() {
85
		super();
86
	}
87

  
88
	// -----------/
89
	// - Methods -/
90
	// -----------/
91

  
92
	/**
93
	 * Returns the value of field 'fieldname'.
94
	 * 
95
	 * @return the value of field 'fieldname'.
96
	 */
97
	public String getFieldname() {
98
		return this._fieldname;
99
	}
100

  
101
	/**
102
	 * Returns the value of field 'fieldseparator'.
103
	 * 
104
	 * @return the value of field 'fieldseparator'.
105
	 */
106
	public Fieldseparator getFieldseparator() {
107
		return this._fieldseparator;
108
	}
109

  
110
	/**
111
	 * Returns the value of field 'fieldtype'.
112
	 * 
113
	 * @return the value of field 'fieldtype'.
114
	 */
115
	public Fieldtype getFieldtype() {
116
		return this._fieldtype;
117
	}
118

  
119
	/**
120
	 * Returns the value of field 'fieldwidth'.
121
	 * 
122
	 * @return the value of field 'fieldwidth'.
123
	 */
124
	public int getFieldwidth() {
125
		return this._fieldwidth;
126
	}
127

  
128
	/**
129
	 * Returns the value of field 'importfield'.
130
	 * 
131
	 * @return the value of field 'importfield'.
132
	 */
133
	public boolean getImportfield() {
134
		return this._importfield;
135
	}
136

  
137
	/**
138
	 * Returns the value of field 'infieldseparators'.
139
	 * 
140
	 * @return the value of field 'infieldseparators'.
141
	 */
142
	public Infieldseparators getInfieldseparators() {
143
		return this._infieldseparators;
144
	}
145

  
146
	/**
147
	 * Sets the value of field 'fieldname'.
148
	 * 
149
	 * @param fieldname
150
	 *            the value of field 'fieldname'.
151
	 */
152
	public void setFieldname(String fieldname) {
153
		this._fieldname = fieldname;
154
	}
155

  
156
	/**
157
	 * Sets the value of field 'fieldseparator'.
158
	 * 
159
	 * @param fieldseparator
160
	 *            the value of field 'fieldseparator'.
161
	 */
162
	public void setFieldseparator(Fieldseparator fieldseparator) {
163
		this._fieldseparator = fieldseparator;
164
	}
165

  
166
	/**
167
	 * Sets the value of field 'fieldtype'.
168
	 * 
169
	 * @param fieldtype
170
	 *            the value of field 'fieldtype'.
171
	 */
172
	public void setFieldtype(Fieldtype fieldtype) {
173
		this._fieldtype = fieldtype;
174
	}
175

  
176
	/**
177
	 * Sets the value of field 'fieldwidth'.
178
	 * 
179
	 * @param fieldwidth
180
	 *            the value of field 'fieldwidth'.
181
	 */
182
	public void setFieldwidth(int fieldwidth) {
183
		this._fieldwidth = fieldwidth;
184
	}
185

  
186
	/**
187
	 * Sets the value of field 'importfield'.
188
	 * 
189
	 * @param importfield
190
	 *            the value of field 'importfield'.
191
	 */
192
	public void setImportfield(boolean importfield) {
193
		this._importfield = importfield;
194
	}
195

  
196
	/**
197
	 * Sets the value of field 'infieldseparators'.
198
	 * 
199
	 * @param infieldseparators
200
	 *            the value of field 'infieldseparators'.
201
	 */
202
	public void setInfieldseparators(Infieldseparators infieldseparators) {
203
		this._infieldseparators = infieldseparators;
204
	}
205

  
206
	public void getstate(IStorage state) {
207
		state.setName("element");
208
		state.setTheClass(this);
209
		state.put("fieldname", this._fieldname);
210
		state.put("fieldtype", this._fieldtype);
211
		state.put("fieldwidth", this._fieldwidth);
212
		state.put("fieldseparator", this._fieldseparator);
213
		state.put("infieldseparators", this._infieldseparators);
214
		state.put("importfield", this._importfield ? "true" : "false");
215
	}
216

  
217
	public void setstate(IStorage state) {
218
		this._fieldname = (String) state.get("fieldname");
219
		this._fieldwidth = (int) state.getInt("fieldwidth");
220
		this._importfield = ((String) state.get("importfield"))
221
				.compareTo("true") == 0 ? true : false;
222
		try {
223
			this._fieldtype = (Fieldtype) state.getObject("fieldtype");
224
			this._fieldseparator = (Fieldseparator) state
225
					.getObject("fieldseparator");
226
			this._infieldseparators = (Infieldseparators) state
227
					.getObject("infieldseparators");
228
		} catch (InstantiationException e) {
229
			// TODO Auto-generated catch block
230
			e.printStackTrace();
231
		} catch (IllegalAccessException e) {
232
			// TODO Auto-generated catch block
233
			e.printStackTrace();
234
		}
235
	}
236

  
237
}
trunk/extensions/extNormalization/src/org/gvsig/patterns/normalization/Datevalue.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (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 Prodevelop S.L. main development
26
 */
27

  
28
package org.gvsig.patterns.normalization;
29

  
30
/**
31
 * 
32
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
33
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
34
 * 
35
 */
36

  
37
import org.gvsig.tools.storage.IStorable;
38
import org.gvsig.tools.storage.IStorage;
39

  
40
/**
41
 * Class Datevalue.
42
 * 
43
 * @version $Revision$ $Date$
44
 */
45
public class Datevalue implements IStorable {
46

  
47
	// --------------------------/
48
	// - Class/Member Variables -/
49
	// --------------------------/
50

  
51
	/**
52
	 * Field _datevalueformat
53
	 */
54
	private String _datevalueformat;
55

  
56
	// ----------------/
57
	// - Constructors -/
58
	// ----------------/
59

  
60
	public Datevalue() {
61
		super();
62
	}
63

  
64
	// -----------/
65
	// - Methods -/
66
	// -----------/
67

  
68
	/**
69
	 * Returns the value of field 'datevalueformat'.
70
	 * 
71
	 * @return the value of field 'datevalueformat'.
72
	 */
73
	public String getDatevalueformat() {
74
		return this._datevalueformat;
75
	}
76

  
77
	/**
78
	 * Sets the value of field 'datevalueformat'.
79
	 * 
80
	 * @param datevalueformat
81
	 *            the value of field 'datevalueformat'.
82
	 */
83
	public void setDatevalueformat(java.lang.String datevalueformat) {
84
		this._datevalueformat = datevalueformat;
85
	}
86

  
87
	public void getstate(IStorage state) {
88
		state.setTheClass(this);
89
		state.put("datevalueformat", this._datevalueformat);
90

  
91
	}
92

  
93
	public void setstate(IStorage state) {
94
		this._datevalueformat = (String) state.get("datevalueformat");
95

  
96
	}
97

  
98
}
trunk/extensions/extNormalization/src/org/gvsig/patterns/normalization/Integervalue.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (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 Prodevelop S.L. main development
26
 */
27

  
28
package org.gvsig.patterns.normalization;
29

  
30
/**
31
 * 
32
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
33
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
34
 * 
35
 */
36

  
37
import org.gvsig.tools.storage.IStorable;
38
import org.gvsig.tools.storage.IStorage;
39

  
40
/**
41
 * Class Integervalue.
42
 * 
43
 * @version $Revision$ $Date$
44
 */
45
public class Integervalue implements IStorable {
46

  
47
	// --------------------------/
48
	// - Class/Member Variables -/
49
	// --------------------------/
50

  
51
	/**
52
	 * Field _integervaluewidth
53
	 */
54
	private int _integervaluewidth;
55
	
56

  
57
	// ----------------/
58
	// - Constructors -/
59
	// ----------------/
60

  
61
	public Integervalue() {
62
		super();
63
	}
64

  
65
	// -----------/
66
	// - Methods -/
67
	// -----------/
68

  
69
	/**
70
	 * Returns the value of field 'integervaluewidth'.
71
	 * 
72
	 * @return the value of field 'integervaluewidth'.
73
	 */
74
	public int getIntegervaluewidth() {
75
		return this._integervaluewidth;
76
	}
77

  
78
	/**
79
	 * Sets the value of field 'integervaluewidth'.
80
	 * 
81
	 * @param integervaluewidth
82
	 *            the value of field 'integervaluewidth'.
83
	 */
84
	public void setIntegervaluewidth(int integervaluewidth) {
85
		this._integervaluewidth = integervaluewidth;
86
	}
87

  
88
	public void getstate(IStorage state) {
89
		state.setTheClass(this);
90
		state.put("integervaluewidth", this._integervaluewidth);
91
	}
92

  
93
	public void setstate(IStorage state) {
94
		this._integervaluewidth = state.getInt("integervaluewidth");
95
	}
96

  
97
}
trunk/extensions/extNormalization/src/org/gvsig/patterns/normalization/Decimalvalue.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (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 Prodevelop S.L. main development
26
 */
27

  
28
package org.gvsig.patterns.normalization;
29

  
30
/**
31
 * 
32
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
33
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
34
 * 
35
 */
36

  
37
import org.gvsig.tools.storage.IStorable;
38
import org.gvsig.tools.storage.IStorage;
39

  
40
/**
41
 * Class Decimalvalue.
42
 * 
43
 * @version $Revision$ $Date$
44
 */
45
public class Decimalvalue implements IStorable {
46

  
47
	// --------------------------/
48
	// - Class/Member Variables -/
49
	// --------------------------/
50

  
51
	/**
52
	 * Field _decimalvalueint
53
	 */
54
	private int _decimalvalueint;
55

  
56
	/**
57
	 * Field _decimalvaluedec
58
	 */
59
	private int _decimalvaluedec;
60

  
61
	// ----------------/
62
	// - Constructors -/
63
	// ----------------/
64

  
65
	public Decimalvalue() {
66
		super();
67
	}
68

  
69
	// -----------/
70
	// - Methods -/
71
	// -----------/
72

  
73
	/**
74
	 * Returns the value of field 'decimalvaluedec'.
75
	 * 
76
	 * @return the value of field 'decimalvaluedec'.
77
	 */
78
	public int getDecimalvaluedec() {
79
		return this._decimalvaluedec;
80
	}
81

  
82
	/**
83
	 * Returns the value of field 'decimalvalueint'.
84
	 * 
85
	 * @return the value of field 'decimalvalueint'.
86
	 */
87
	public int getDecimalvalueint() {
88
		return this._decimalvalueint;
89
	}
90

  
91
	/**
92
	 * Sets the value of field 'decimalvaluedec'.
93
	 * 
94
	 * @param decimalvaluedec
95
	 *            the value of field 'decimalvaluedec'.
96
	 */
97
	public void setDecimalvaluedec(int decimalvaluedec) {
98
		this._decimalvaluedec = decimalvaluedec;
99
	}
100

  
101
	/**
102
	 * Sets the value of field 'decimalvalueint'.
103
	 * 
104
	 * @param decimalvalueint
105
	 *            the value of field 'decimalvalueint'.
106
	 */
107
	public void setDecimalvalueint(int decimalvalueint) {
108
		this._decimalvalueint = decimalvalueint;
109
	}
110

  
111
	public void getstate(IStorage state) {
112
		state.setTheClass(this);
113
		state.put("decimalvalueint", this._decimalvalueint);
114
		state.put("decimalvaluedec", this._decimalvaluedec);
115

  
116
	}
117

  
118
	public void setstate(IStorage state) {
119
		this._decimalvalueint = state.getInt("decimalvalueint");
120
		this._decimalvaluedec = state.getInt("decimalvaluedec");
121
	}
122

  
123
}
trunk/extensions/extNormalization/src/org/gvsig/patterns/normalization/Infieldseparators.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (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 Prodevelop S.L. main development
26
 */
27

  
28
package org.gvsig.patterns.normalization;
29

  
30
/**
31
 * 
32
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
33
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
34
 * 
35
 */
36

  
37
import org.gvsig.tools.storage.IStorable;
38
import org.gvsig.tools.storage.IStorage;
39

  
40
/**
41
 * Class Infieldseparators.
42
 * 
43
 * @version $Revision$ $Date$
44
 */
45
public class Infieldseparators implements IStorable {
46

  
47
	// --------------------------/
48
	// - Class/Member Variables -/
49
	// --------------------------/
50

  
51
	/**
52
	 * Field _thousandseparator
53
	 */
54
	private String _thousandseparator;
55

  
56
	/**
57
	 * Field _decimalseparator
58
	 */
59
	private String _decimalseparator;
60

  
61
	/**
62
	 * Field _textseparator
63
	 */
64
	private String _textseparator;
65

  
66
	// ----------------/
67
	// - Constructors -/
68
	// ----------------/
69

  
70
	public Infieldseparators() {
71
		super();
72
	}
73

  
74
	// -----------/
75
	// - Methods -/
76
	// -----------/
77

  
78
	/**
79
	 * Returns the value of field 'decimalseparator'.
80
	 * 
81
	 * @return the value of field 'decimalseparator'.
82
	 */
83
	public String getDecimalseparator() {
84
		return this._decimalseparator;
85
	}
86

  
87
	/**
88
	 * Returns the value of field 'textseparator'.
89
	 * 
90
	 * @return the value of field 'textseparator'.
91
	 */
92
	public String getTextseparator() {
93
		return this._textseparator;
94
	}
95

  
96
	/**
97
	 * Returns the value of field 'thousandseparator'.
98
	 * 
99
	 * @return the value of field 'thousandseparator'.
100
	 */
101
	public String getThousandseparator() {
102
		return this._thousandseparator;
103
	}
104

  
105
	/**
106
	 * Sets the value of field 'decimalseparator'.
107
	 * 
108
	 * @param decimalseparator
109
	 *            the value of field 'decimalseparator'
110
	 */
111
	public void setDecimalseparator(String decimalseparator) {
112
		this._decimalseparator = decimalseparator;
113
	}
114

  
115
	/**
116
	 * Sets the value of field 'textseparator'.
117
	 * 
118
	 * @param textseparator
119
	 *            the value of field 'textseparator'.
120
	 */
121
	public void setTextseparator(String textseparator) {
122
		this._textseparator = textseparator;
123
	}
124

  
125
	/**
126
	 * Sets the value of field 'thousandseparator'.
127
	 * 
128
	 * @param thousandseparator
129
	 *            the value of field 'thousandseparator'.
130
	 */
131
	public void setThousandseparator(String thousandseparator) {
132
		this._thousandseparator = thousandseparator;
133
	}
134

  
135
	public void getstate(IStorage state) {
136
		state.setTheClass(this);
137
		state.put("thousandseparator", this._thousandseparator);
138
		state.put("decimalseparator", this._decimalseparator);
139
		state.put("textseparator", this._textseparator);
140

  
141
	}
142

  
143
	public void setstate(IStorage state) {
144
		this._thousandseparator = (String) state.get("thousandseparator");
145
		this._decimalseparator = (String) state.get("decimalseparator");
146
		this._textseparator = (String) state.get("textseparator");
147

  
148
	}
149

  
150
}

Also available in: Unified diff