1 | package com.vividsolutions.jump.feature;
|
---|
2 |
|
---|
3 | import com.vividsolutions.jts.geom.Geometry;
|
---|
4 |
|
---|
5 | public interface Feature extends Cloneable, Comparable {
|
---|
6 | /**
|
---|
7 | * A low-level accessor that is not normally used. attributes may have a different
|
---|
8 | * length than the current attributes.
|
---|
9 | */
|
---|
10 | public abstract void setAttributes(Object[] attributes);
|
---|
11 | /**
|
---|
12 | * A low-level accessor that is not normally used.
|
---|
13 | */
|
---|
14 | public abstract void setSchema(FeatureSchema schema);
|
---|
15 | /**
|
---|
16 | * Returns a number that uniquely identifies this feature. This number is not
|
---|
17 | * persistent. (Implementors can obtain an ID from FeatureUtil#nextID).
|
---|
18 | * @return n, where this feature is the nth Feature created by this application
|
---|
19 | */
|
---|
20 | public abstract int getID();
|
---|
21 | /**
|
---|
22 | * Sets the specified attribute.
|
---|
23 | *
|
---|
24 | *@param attributeIndex the array index at which to put the new attribute
|
---|
25 | *@param newAttribute the new attribute
|
---|
26 | */
|
---|
27 | public abstract void setAttribute(int attributeIndex, Object newAttribute);
|
---|
28 | /**
|
---|
29 | * Sets the specified attribute.
|
---|
30 | *
|
---|
31 | *@param attributeName the name of the attribute to set
|
---|
32 | *@param newAttribute the new attribute
|
---|
33 | */
|
---|
34 | public abstract void setAttribute(
|
---|
35 | String attributeName,
|
---|
36 | Object newAttribute);
|
---|
37 | /**
|
---|
38 | * Convenience method for setting the spatial attribute. JUMP Workbench
|
---|
39 | * PlugIns and CursorTools should not use this method directly, but should use an
|
---|
40 | * EditTransaction, so that the proper events are fired.
|
---|
41 | *
|
---|
42 | *@param geometry the new spatial attribute
|
---|
43 | */
|
---|
44 | public abstract void setGeometry(Geometry geometry);
|
---|
45 | /**
|
---|
46 | * Returns the specified attribute.
|
---|
47 | *
|
---|
48 | *@param i the index of the attribute to get
|
---|
49 | *@return the attribute
|
---|
50 | */
|
---|
51 | public abstract Object getAttribute(int i);
|
---|
52 | /**
|
---|
53 | * Returns the specified attribute.
|
---|
54 | *
|
---|
55 | *@param name the name of the attribute to get
|
---|
56 | *@return the attribute
|
---|
57 | */
|
---|
58 | public abstract Object getAttribute(String name);
|
---|
59 | //<<TODO:DOC>>Update JavaDoc -- the attribute need not be a String [Jon Aquino]
|
---|
60 | public abstract String getString(int attributeIndex);
|
---|
61 | /**
|
---|
62 | * Returns a integer attribute.
|
---|
63 | *
|
---|
64 | *@param attributeIndex the index of the attribute to retrieve
|
---|
65 | *@return the integer attribute with the given name
|
---|
66 | */
|
---|
67 | public abstract int getInteger(int attributeIndex);
|
---|
68 | /**
|
---|
69 | * Returns a double attribute.
|
---|
70 | *
|
---|
71 | *@param attributeIndex the index of the attribute to retrieve
|
---|
72 | *@return the double attribute with the given name
|
---|
73 | */
|
---|
74 | public abstract double getDouble(int attributeIndex);
|
---|
75 | //<<TODO:DOC>>Update JavaDoc -- the attribute need not be a String [Jon Aquino]
|
---|
76 | public abstract String getString(String attributeName);
|
---|
77 | /**
|
---|
78 | * Convenience method for returning the spatial attribute.
|
---|
79 | *
|
---|
80 | *@return the feature's spatial attribute
|
---|
81 | */
|
---|
82 | public abstract Geometry getGeometry();
|
---|
83 | /**
|
---|
84 | * Returns the feature's metadata
|
---|
85 | *
|
---|
86 | *@return the metadata describing the names and types of the attributes
|
---|
87 | */
|
---|
88 | public abstract FeatureSchema getSchema();
|
---|
89 | /**
|
---|
90 | * Clones this Feature. The geometry will also be cloned.
|
---|
91 | * @return a new Feature with the same attributes as this Feature
|
---|
92 | */
|
---|
93 | public abstract Object clone();
|
---|
94 | /**
|
---|
95 | * Clones this Feature.
|
---|
96 | * @param deep whether or not to clone the geometry
|
---|
97 | * @return a new Feature with the same attributes as this Feature
|
---|
98 | */
|
---|
99 | public abstract Feature clone(boolean deep);
|
---|
100 | /**
|
---|
101 | * A low-level accessor that is not normally used.
|
---|
102 | */
|
---|
103 | public abstract Object[] getAttributes();
|
---|
104 | }
|
---|