root / trunk / extensions / extNormalization / src / org / gvsig / patterns / normalization / Fieldseparator.java @ 22976
History | View | Annotate | Download (5.33 KB)
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 |
} |