public interface Feature
extends java.lang.Cloneable, java.lang.Comparable
In the current Workbench model, each feature has one spatial attribute (Geometry) and zero or more non-spatial attributes.
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clones this Feature.
|
Feature |
clone(boolean deep)
Clones this Feature.
|
Feature |
clone(boolean deep,
boolean copyPK)
Clones this Feature.
|
java.lang.Object |
getAttribute(int i)
Returns the specified attribute.
|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the specified attribute.
|
java.lang.Object[] |
getAttributes()
A low-level accessor that is not normally used.
|
double |
getDouble(int attributeIndex)
Returns a double attribute.
|
com.vividsolutions.jts.geom.Geometry |
getGeometry()
Convenience method for returning the spatial attribute.
|
int |
getID()
Returns a number that uniquely identifies this feature.
|
int |
getInteger(int attributeIndex)
Returns a integer attribute.
|
FeatureSchema |
getSchema()
Returns the feature's metadata
|
java.lang.String |
getString(int attributeIndex)
Returns the result of calling #toString on the attribute at the given (zero-based)
index, or "" if it is null.
|
java.lang.String |
getString(java.lang.String attributeName)
Returns the result of calling #toString on the attribute with the given
(case-sensitive) name, or "" if it is null.
|
void |
setAttribute(int attributeIndex,
java.lang.Object newAttribute)
Sets the specified attribute.
|
void |
setAttribute(java.lang.String attributeName,
java.lang.Object newAttribute)
Sets the specified attribute.
|
void |
setAttributes(java.lang.Object[] attributes)
A low-level accessor that is not normally used.
|
void |
setGeometry(com.vividsolutions.jts.geom.Geometry geometry)
Convenience method for setting the spatial attribute.
|
void |
setSchema(FeatureSchema schema)
A low-level accessor that is not normally used.
|
void setAttributes(java.lang.Object[] attributes)
attributes
- may have a different
length than the current attributes.void setSchema(FeatureSchema schema)
int getID()
void setAttribute(int attributeIndex, java.lang.Object newAttribute)
attributeIndex
- the array index at which to put the new attributenewAttribute
- the new attributevoid setAttribute(java.lang.String attributeName, java.lang.Object newAttribute)
attributeName
- the name of the attribute to setnewAttribute
- the new attributevoid setGeometry(com.vividsolutions.jts.geom.Geometry geometry)
geometry
- the new spatial attributejava.lang.Object getAttribute(int i)
i
- the index of the attribute to getjava.lang.Object getAttribute(java.lang.String name)
name
- the name of the attribute to getjava.lang.String getString(int attributeIndex)
int getInteger(int attributeIndex)
attributeIndex
- the index of the attribute to retrievedouble getDouble(int attributeIndex)
attributeIndex
- the index of the attribute to retrievejava.lang.String getString(java.lang.String attributeName)
com.vividsolutions.jts.geom.Geometry getGeometry()
FeatureSchema getSchema()
java.lang.Object clone()
Feature clone(boolean deep)
deep
- whether or not to clone the geometryFeature clone(boolean deep, boolean copyPK)
deep
- whether or not to clone the geometrycopyPK
- whether or not to copy external PK attribute if existsjava.lang.Object[] getAttributes()