Revision 20131 trunk/libraries/libDataSource/src/org/gvsig/data/vectorial/DefaultFeatureType.java
DefaultFeatureType.java | ||
---|---|---|
13 | 13 |
private String defaultSRS; |
14 | 14 |
private int[] geometryTypes=new int[]{1}; |
15 | 15 |
private DateFormat dateFormat=DateFormat.getDateInstance(); |
16 |
private String fieldId; |
|
17 |
private int fieldIdIndex = -1; |
|
16 |
private String[] fieldsId; |
|
18 | 17 |
|
19 | 18 |
public void addRule(IFeatureRule rule) { |
20 | 19 |
featureRules.add(rule); |
... | ... | |
102 | 101 |
this.geometryTypes=geometryTypes; |
103 | 102 |
} |
104 | 103 |
|
105 |
public String getFieldId() {
|
|
106 |
return fieldId; |
|
104 |
public String[] getFieldsId() {
|
|
105 |
return fieldsId;
|
|
107 | 106 |
} |
108 | 107 |
|
109 |
public void setFieldId(String fieldId) { |
|
110 |
this.fieldId=fieldId; |
|
111 |
this.fieldIdIndex = this.getFieldIndex(fieldId); |
|
108 |
public void setFieldsId(String[] fieldsId) { |
|
109 |
this.fieldsId=fieldsId; |
|
112 | 110 |
} |
113 | 111 |
|
114 | 112 |
public int getFieldIndex(String name) { |
... | ... | |
129 | 127 |
((DefaultAttributeDescriptor)arg0).setOrdinal(this.size()); |
130 | 128 |
return super.add(arg0); |
131 | 129 |
} |
132 |
public int getFieldIdIndex() { |
|
133 |
if (fieldIdIndex < 0){ |
|
134 |
this.fieldIdIndex = this.getFieldIndex(fieldId); |
|
135 |
} |
|
136 |
return this.fieldIdIndex; |
|
137 |
} |
|
138 | 130 |
|
139 | 131 |
public IFeatureType cloneFeatureType() { |
140 | 132 |
DefaultFeatureType newFType = (DefaultFeatureType) this.newFeatureType(); |
... | ... | |
145 | 137 |
newFType.dateFormat = this.dateFormat; |
146 | 138 |
newFType.defaultSRS = this.defaultSRS; |
147 | 139 |
newFType.featureRules.addAll(this.featureRules); |
148 |
newFType.fieldId = this.fieldId; |
|
149 |
newFType.fieldIdIndex = this.fieldIdIndex; |
|
140 |
if (this.fieldsId != null){ |
|
141 |
newFType.fieldsId = new String[this.fieldsId.length]; |
|
142 |
System.arraycopy(this.fieldsId, 0, newFType.fieldsId, 0, this.fieldsId.length); |
|
143 |
} |
|
150 | 144 |
newFType.geometryColumn = this.geometryColumn; |
151 | 145 |
if (this.geometryTypes != null){ |
152 | 146 |
newFType.geometryTypes = new int[this.geometryTypes.length]; |
Also available in: Unified diff