Package com.vividsolutions.jump.feature
Class FlexibleFeature
- java.lang.Object
-
- com.vividsolutions.jump.feature.AbstractBasicFeature
-
- com.vividsolutions.jump.feature.BasicFeature
-
- com.vividsolutions.jump.feature.FlexibleFeature
-
- All Implemented Interfaces:
Feature,Serializable,Cloneable,Comparable
public class FlexibleFeature extends BasicFeature
a FlexibleFeature based onBasicFeatureoriginally used by the GeoJSON reader. currently adding this functionality - "autoextends" by returning null for undefined attribs - lazy conversion of attributes (seegetAttribute(int)) currently String, Date, Time, Timestamp- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FlexibleFeature(FeatureSchema featureSchema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(int i)Returns the specified attribute.Object[]getAttributes()Returns all attributes in an array of Objects.org.locationtech.jts.geom.GeometrygetGeometry()getting the geometry by explicitly using the flexible getAttribute() method abovevoidsetAttribute(int attributeIndex, Object newAttribute)setting an attribute, fixing the underlying array in case the schema changed inbetweenvoidsetGeometry(org.locationtech.jts.geom.Geometry geometry)setting the geometry by explicitly using the flexible setAttribute() method above-
Methods inherited from class com.vividsolutions.jump.feature.BasicFeature
isModified, setAttributes, setModified
-
Methods inherited from class com.vividsolutions.jump.feature.AbstractBasicFeature
clone, clone, clone, clone, compare, compareTo, getAttribute, getDouble, getID, getInteger, getSchema, getString, getString, getUserData, removeAllUserData, removeUserData, setAttribute, setSchema, setUserData
-
-
-
-
Constructor Detail
-
FlexibleFeature
public FlexibleFeature(FeatureSchema featureSchema)
-
-
Method Detail
-
getAttribute
public Object getAttribute(int i)
Description copied from class:BasicFeatureReturns the specified attribute.- Specified by:
getAttributein interfaceFeature- Overrides:
getAttributein classBasicFeature- Parameters:
i- the index of the attribute to get- Returns:
- the attribute
-
getAttributes
public Object[] getAttributes()
Returns all attributes in an array of Objects. Use getAttribute(i) to convert raw gml strings into typed attributes.- Specified by:
getAttributesin interfaceFeature- Overrides:
getAttributesin classBasicFeature
-
setAttribute
public void setAttribute(int attributeIndex, Object newAttribute)setting an attribute, fixing the underlying array in case the schema changed inbetween- Specified by:
setAttributein interfaceFeature- Overrides:
setAttributein classBasicFeature- Parameters:
attributeIndex- the array index at which to put the new attributenewAttribute- the new attribute
-
setGeometry
public void setGeometry(org.locationtech.jts.geom.Geometry geometry)
setting the geometry by explicitly using the flexible setAttribute() method above- Specified by:
setGeometryin interfaceFeature- Overrides:
setGeometryin classAbstractBasicFeature- Parameters:
geometry- the new spatial attribute
-
getGeometry
public org.locationtech.jts.geom.Geometry getGeometry()
getting the geometry by explicitly using the flexible getAttribute() method above- Specified by:
getGeometryin interfaceFeature- Overrides:
getGeometryin classAbstractBasicFeature- Returns:
- the feature's spatial attribute
-
-