01: package org.geotools.xml.impl.jxpath;
02:
03: import org.apache.commons.jxpath.ri.model.NodeIterator;
04: import org.apache.commons.jxpath.ri.model.NodePointer;
05: import org.geotools.feature.Feature;
06:
07: public class FeaturePropertyIterator implements NodeIterator {
08:
09: /**
10: * The feature node pointer
11: */
12: FeaturePointer pointer;
13: /**
14: * The feature.
15: */
16: Feature feature;
17: /**
18: * current position
19: */
20: int position;
21:
22: public FeaturePropertyIterator(FeaturePointer pointer) {
23: this .pointer = pointer;
24: feature = (Feature) pointer.getImmediateNode();
25: position = 1;
26: }
27:
28: public int getPosition() {
29: return position;
30: }
31:
32: public boolean setPosition(int position) {
33: this .position = position;
34: return position <= feature.getNumberOfAttributes();
35: }
36:
37: public NodePointer getNodePointer() {
38: return new FeaturePropertyPointer(pointer, position - 1);
39: }
40:
41: }
|