com.vividsolutions.jump.feature
Interface Feature

All Superinterfaces:
java.lang.Cloneable, java.lang.Comparable
All Known Implementing Classes:
AbstractBasicFeature, BasicFeature

public interface Feature
extends java.lang.Cloneable, java.lang.Comparable

A representation of an object in the world, including its location, geometry, and other attributes. A Feature has spatial attributes (polygons, points, etc.) and non-spatial attributes (strings, dates, and numbers).

In the current Workbench model, each feature has one spatial attribute (Geometry) and zero or more non-spatial attributes.


Method Summary
 java.lang.Object clone()
          Clones this Feature.
 Feature clone(boolean deep)
          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.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

setAttributes

void setAttributes(java.lang.Object[] attributes)
A low-level accessor that is not normally used.

Parameters:
attributes - may have a different length than the current attributes.

setSchema

void setSchema(FeatureSchema schema)
A low-level accessor that is not normally used.


getID

int getID()
Returns a number that uniquely identifies this feature. This number is not persistent. (Implementors can obtain an ID from FeatureUtil#nextID).

Returns:
n, where this feature is the nth Feature created by this application

setAttribute

void setAttribute(int attributeIndex,
                  java.lang.Object newAttribute)
Sets the specified attribute.

Parameters:
attributeIndex - the array index at which to put the new attribute
newAttribute - the new attribute

setAttribute

void setAttribute(java.lang.String attributeName,
                  java.lang.Object newAttribute)
Sets the specified attribute.

Parameters:
attributeName - the name of the attribute to set
newAttribute - the new attribute

setGeometry

void setGeometry(com.vividsolutions.jts.geom.Geometry geometry)
Convenience method for setting the spatial attribute. JUMP Workbench PlugIns and CursorTools should not use this method directly, but should use an EditTransaction, so that the proper events are fired.

Parameters:
geometry - the new spatial attribute

getAttribute

java.lang.Object getAttribute(int i)
Returns the specified attribute.

Parameters:
i - the index of the attribute to get
Returns:
the attribute

getAttribute

java.lang.Object getAttribute(java.lang.String name)
Returns the specified attribute.

Parameters:
name - the name of the attribute to get
Returns:
the attribute

getString

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. Note that this method may be called even if the attribute is not of type AttributeType.STRING.


getInteger

int getInteger(int attributeIndex)
Returns a integer attribute.

Parameters:
attributeIndex - the index of the attribute to retrieve
Returns:
the integer attribute with the given name

getDouble

double getDouble(int attributeIndex)
Returns a double attribute.

Parameters:
attributeIndex - the index of the attribute to retrieve
Returns:
the double attribute with the given name

getString

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. Note that this method may be called even if the attribute is not of type AttributeType.STRING.


getGeometry

com.vividsolutions.jts.geom.Geometry getGeometry()
Convenience method for returning the spatial attribute.

Returns:
the feature's spatial attribute

getSchema

FeatureSchema getSchema()
Returns the feature's metadata

Returns:
the metadata describing the names and types of the attributes

clone

java.lang.Object clone()
Clones this Feature. The geometry will also be cloned.

Returns:
a new Feature with the same attributes as this Feature

clone

Feature clone(boolean deep)
Clones this Feature.

Parameters:
deep - whether or not to clone the geometry
Returns:
a new Feature with the same attributes as this Feature

getAttributes

java.lang.Object[] getAttributes()
A low-level accessor that is not normally used.