root / trunk / libraries / libFMap_dataDB / src / org / gvsig / data / datastores / vectorial / db / DBFeatureType.java @ 20908
History | View | Annotate | Download (1.62 KB)
1 |
package org.gvsig.data.datastores.vectorial.db; |
---|---|
2 |
|
3 |
import java.util.ArrayList; |
4 |
import java.util.Iterator; |
5 |
|
6 |
import org.gvsig.data.vectorial.AttributeDescriptor; |
7 |
import org.gvsig.data.vectorial.FeatureType; |
8 |
import org.gvsig.data.vectorial.IFeatureAttributeDescriptor; |
9 |
import org.gvsig.data.vectorial.IFeatureType; |
10 |
|
11 |
public class DBFeatureType extends FeatureType { |
12 |
private String tableID; |
13 |
private boolean readOnly=false; |
14 |
|
15 |
public String getTableID() { |
16 |
return tableID;
|
17 |
} |
18 |
|
19 |
public void setTableID(String tableID) { |
20 |
this.tableID = tableID;
|
21 |
} |
22 |
|
23 |
protected IFeatureType newFeatureType() {
|
24 |
return new DBFeatureType(); |
25 |
} |
26 |
|
27 |
public IFeatureType cloneFeatureType() {
|
28 |
DBFeatureType newFType = (DBFeatureType)super.cloneFeatureType();
|
29 |
newFType.tableID = this.tableID;
|
30 |
return newFType;
|
31 |
} |
32 |
|
33 |
public String[] getFields() { |
34 |
Iterator iterator=this.iterator(); |
35 |
ArrayList names=new ArrayList(); |
36 |
while (iterator.hasNext()) {
|
37 |
IFeatureAttributeDescriptor fad = (IFeatureAttributeDescriptor) iterator.next(); |
38 |
names.add(fad.getName()); |
39 |
} |
40 |
return (String[])names.toArray(new String[0]); |
41 |
} |
42 |
|
43 |
public void setReadOnly(boolean readOnly){ |
44 |
this.readOnly = readOnly;
|
45 |
} |
46 |
|
47 |
public boolean isReadOnly(){ |
48 |
return this.readOnly; |
49 |
} |
50 |
|
51 |
/* (non-Javadoc)
|
52 |
* @see org.gvsig.data.vectorial.IFeatureType#createNewAttributeDescriptor()
|
53 |
*/
|
54 |
public IFeatureAttributeDescriptor createNewAttributeDescriptor() {
|
55 |
return new DBAttributeDescriptor(this,true); |
56 |
} |
57 |
|
58 |
|
59 |
public IFeatureAttributeDescriptor createAttributeDescriptor() {
|
60 |
return new DBAttributeDescriptor(this,false); |
61 |
} |
62 |
|
63 |
} |