Revision 30079
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/DataTypes.java | ||
---|---|---|
1 | 1 |
package org.gvsig.fmap.dal; |
2 | 2 |
|
3 |
import java.io.File; |
|
4 |
import java.util.Date; |
|
5 |
import java.util.List; |
|
6 |
import java.util.Map; |
|
7 |
import java.util.Set; |
|
3 | 8 |
|
9 |
import org.cresques.cts.IProjection; |
|
10 |
import org.gvsig.fmap.dal.feature.Feature; |
|
11 |
import org.gvsig.fmap.geom.Geometry; |
|
12 |
import org.gvsig.tools.persistence.Persistent; |
|
13 |
|
|
14 |
|
|
4 | 15 |
/** |
5 | 16 |
* This interface defines a set of constants for all data types supported by the |
6 | 17 |
* DAL. |
7 | 18 |
*/ |
8 | 19 |
public interface DataTypes extends org.gvsig.tools.dataTypes.DataTypes { |
9 | 20 |
|
21 |
public static final Class TYPE_CLASS[] = new Class[] { |
|
22 |
null, |
|
23 |
Boolean.class, |
|
24 |
Byte.class, // keep for formatting |
|
25 |
Character.class, |
|
26 |
Integer.class, |
|
27 |
Long.class, |
|
28 |
Float.class, |
|
29 |
Double.class, |
|
30 |
String.class, |
|
31 |
Date.class, |
|
32 |
Date.class, |
|
33 |
Date.class, |
|
34 |
Geometry.class, |
|
35 |
Object.class, // |
|
36 |
Feature.class, |
|
37 |
IProjection.class, |
|
38 |
File.class, |
|
39 |
new byte[] {}.getClass(), |
|
40 |
Persistent.class, |
|
41 |
List.class, |
|
42 |
Set.class, |
|
43 |
Map.class |
|
44 |
|
|
45 |
}; |
|
10 | 46 |
} |
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeatureAttributeDescriptor.java | ||
---|---|---|
1 | 1 |
package org.gvsig.fmap.dal.feature.impl; |
2 | 2 |
|
3 |
import java.io.File; |
|
4 | 3 |
import java.text.DateFormat; |
5 |
import java.util.Date; |
|
6 | 4 |
import java.util.HashMap; |
7 | 5 |
import java.util.Iterator; |
8 | 6 |
import java.util.Map; |
... | ... | |
10 | 8 |
|
11 | 9 |
import org.cresques.cts.IProjection; |
12 | 10 |
import org.gvsig.fmap.dal.DataTypes; |
13 |
import org.gvsig.fmap.dal.feature.Feature; |
|
14 | 11 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
15 | 12 |
import org.gvsig.fmap.dal.feature.exception.UnsupportedDataTypeException; |
16 | 13 |
import org.gvsig.fmap.geom.Geometry; |
... | ... | |
40 | 37 |
protected boolean isAutomatic; |
41 | 38 |
|
42 | 39 |
|
43 |
private static final Class TYPE_CLASS[] = new Class[] { |
|
44 |
null, |
|
45 |
Boolean.class, |
|
46 |
Byte.class, // keep for formatting |
|
47 |
Character.class, |
|
48 |
Integer.class, |
|
49 |
Long.class, |
|
50 |
Float.class, |
|
51 |
Double.class, |
|
52 |
String.class, |
|
53 |
Date.class, |
|
54 |
Date.class, |
|
55 |
Date.class, |
|
56 |
Geometry.class, |
|
57 |
Object.class, // |
|
58 |
Feature.class, |
|
59 |
IProjection.class, |
|
60 |
File.class, |
|
61 |
new byte[] {}.getClass() |
|
62 |
|
|
63 |
}; |
|
64 |
|
|
65 | 40 |
protected DefaultFeatureAttributeDescriptor() { |
66 | 41 |
this.allowNull = true; |
67 | 42 |
this.dataType = DataTypes.UNKNOWN; |
... | ... | |
175 | 150 |
} |
176 | 151 |
|
177 | 152 |
public Class getObjectClass() { |
178 |
if (this.dataType > TYPE_CLASS.length || this.dataType < 0) { |
|
153 |
if (this.dataType > DataTypes.TYPE_CLASS.length || this.dataType < 0) {
|
|
179 | 154 |
throw new UnsupportedDataTypeException(this.name, this.dataType); |
180 | 155 |
} |
181 |
return TYPE_CLASS[this.dataType]; |
|
156 |
return DataTypes.TYPE_CLASS[this.dataType];
|
|
182 | 157 |
} |
183 | 158 |
|
184 | 159 |
public int getPrecision() { |
Also available in: Unified diff