Class AbstractBasicFeature
- java.lang.Object
-
- org.locationtech.jts.jump.feature.AbstractBasicFeature
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
,Feature
- Direct Known Subclasses:
BasicFeature
public abstract class AbstractBasicFeature extends Object implements Feature, Serializable
Default implementation of the Feature interface. Subclasses need implement only the four remaining Feature methods: #getAttribute, #setAttribute, #getAttributes, #setAttributes- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractBasicFeature(FeatureSchema featureSchema)
Creates a new Feature based on the given metadata.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Clones this Feature.Feature
clone(boolean deep)
Clones this Feature.static BasicFeature
clone(Feature feature, boolean deep)
static int
compare(Feature a, Feature b)
int
compareTo(Object o)
Object
getAttribute(String name)
Returns the specified attribute.double
getDouble(int attributeIndex)
Returns a double attribute.org.locationtech.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 metadataString
getString(int attributeIndex)
Returns a String attribute.String
getString(String attributeName)
Returns a String attribute.void
setAttribute(String attributeName, Object newAttribute)
Sets the specified attribute.void
setGeometry(org.locationtech.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 class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.locationtech.jts.jump.feature.Feature
getAttribute, getAttributes, setAttribute, setAttributes
-
-
-
-
Constructor Detail
-
AbstractBasicFeature
public AbstractBasicFeature(FeatureSchema featureSchema)
Creates a new Feature based on the given metadata.- Parameters:
featureSchema
- the metadata containing information on each column
-
-
Method Detail
-
setSchema
public void setSchema(FeatureSchema schema)
A low-level accessor that is not normally used.
-
getID
public int getID()
Returns a number that uniquely identifies this feature. This number is not persistent.
-
setAttribute
public void setAttribute(String attributeName, Object newAttribute)
Sets the specified attribute.- Specified by:
setAttribute
in interfaceFeature
- Parameters:
attributeName
- the name of the attribute to setnewAttribute
- the new attribute
-
setGeometry
public void setGeometry(org.locationtech.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.- Specified by:
setGeometry
in interfaceFeature
- Parameters:
geometry
- the new spatial attribute
-
getAttribute
public Object getAttribute(String name)
Returns the specified attribute.- Specified by:
getAttribute
in interfaceFeature
- Parameters:
name
- the name of the attribute to get- Returns:
- the attribute
-
getString
public String getString(int attributeIndex)
Returns a String attribute. The attribute at the given index must be a String.
-
getInteger
public int getInteger(int attributeIndex)
Returns a integer attribute.- Specified by:
getInteger
in interfaceFeature
- Parameters:
attributeIndex
- the index of the attribute to retrieve- Returns:
- the integer attribute with the given name
-
getDouble
public double getDouble(int attributeIndex)
Returns a double attribute.
-
getString
public String getString(String attributeName)
Returns a String attribute. The attribute with the given name must be a String.
-
getGeometry
public org.locationtech.jts.geom.Geometry getGeometry()
Convenience method for returning the spatial attribute.- Specified by:
getGeometry
in interfaceFeature
- Returns:
- the feature's spatial attribute
-
getSchema
public FeatureSchema getSchema()
Returns the feature's metadata
-
clone
public Object clone()
Clones this Feature. The geometry will also be cloned.
-
clone
public Feature clone(boolean deep)
Clones this Feature.
-
clone
public static BasicFeature clone(Feature feature, boolean deep)
-
compareTo
public int compareTo(Object o)
- Specified by:
compareTo
in interfaceComparable
-
-