01: /**
02: *
03: */package org.geotools.feature.iso.simple;
04:
05: import java.util.List;
06:
07: import org.opengis.feature.Attribute;
08: import org.opengis.feature.type.AttributeDescriptor;
09: import org.opengis.feature.type.AttributeType;
10: import org.opengis.feature.type.Name;
11: import org.opengis.feature.type.PropertyDescriptor;
12:
13: /**
14: * Attribute that delegates to its parent array features based on index.
15: *
16: * @author Jody
17: */
18: class IndexAttribute implements Attribute {
19: /**
20: *
21: */
22: ArraySimpleFeature feature;
23:
24: int index;
25:
26: IndexDescriptor descriptor;
27:
28: public IndexAttribute(ArraySimpleFeature feature, int index) {
29: this .feature = feature;
30: this .index = index;
31: descriptor = new IndexDescriptor(this .feature, index);
32: }
33:
34: public AttributeDescriptor getDescriptor() {
35: return descriptor;
36: }
37:
38: public boolean nillable() {
39: return true;
40: }
41:
42: public AttributeType getType() {
43: return this .feature.type.getType(index);
44: }
45:
46: public String getID() {
47: return null;
48: }
49:
50: public Object getValue() {
51: return this .feature.values[index];
52: }
53:
54: public void setValue(Object value) throws IllegalArgumentException {
55: this .feature.values[index] = value;
56: }
57:
58: public PropertyDescriptor descriptor() {
59: return descriptor;
60: }
61:
62: public Name name() {
63: return descriptor.getName();
64: }
65:
66: public Object operation(Name arg0, List arg1) {
67: throw new UnsupportedOperationException(
68: "operation not supported yet");
69: }
70:
71: }
|