Interface Feature
- All Superinterfaces:
org.gvsig.tools.util.GetItemByKey<String,,Object> org.gvsig.tools.util.GetItemByKeyWithSize<String,,Object> org.gvsig.tools.util.GetItemByKeyWithSizeAndGetKeys<String,,Object> org.gvsig.tools.util.GetKeys<String>,org.gvsig.tools.util.Size,org.gvsig.json.SupportToJson
- All Known Subinterfaces:
EditableFeature
Represents the basic data unit of a tabular structure, equivalent to a record in a data base table. In SIG domain, a Feature is a compound data structure that may contain a geographic component. The conventional term Feature comes from the term cartographic feature and both represent the same concept.
A Feature may contain more than one geometry attribute. In the case there is
not any geometry data, the getDefaultGeometry() will return
null.
Features are not editable as such. To edit a Feature you have to obtain an
editable instance EditableFeature using the method
getEditable(). Modify that editable instance and then apply the
changes to the Feature. This mechanism is to avoid ambiguity and loosing
track on the Feature internal state.
The Feature:
- Has an unique identifier
FeatureReferenceto recognize our Feature from each other from the same data store - Has a
FeatureTypethat describes the Feature characteristics (attributes, data types, default geometry, validation rules). - Can obtain a copy of itself.
- Can obtain its default geometry attribute and also a list with all the geometry attributes.
- Can obtain its default Spatial Reference System and also a list with all the SRSs used in the geometry attributes.
- Can obtain the envelope (extent) of the default geometry attribute.
- Can obtain the editable instance of the Feature.
- Has a set of utility methods to read attributes when their type is known, by both index and name.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionorg.gvsig.expressionevaluator.ExpressionBuilderorg.gvsig.expressionevaluator.Expressionformat(int index) get(int index) Returns the value of an attribute given its position.Returns the value of an attribute given its name.Object[]getArray(int index) Returns the array value of an attribute given its position.Object[]Returns the array value of an attribute given its name.org.gvsig.tools.dynobject.DynObjectbooleangetBoolean(int index) Returns the Boolean value of an attribute given its position.booleangetBoolean(String name) Returns the Boolean value of an attribute given its name.booleangetBooleanOrDefault(int index, boolean defaultValue) booleangetBooleanOrDefault(String name, boolean defaultValue) bytegetByte(int index) Returns the byte value of an attribute given its position.byteReturns the byte value of an attribute given its name.byte[]getByteArray(int index) byte[]getByteArray(String name) getCopy()Creates and returns a copy of thisintgetDate(int index) Returns the Date value of an attribute given its position.Returns the Date value of an attribute given its name.getDateOrDefault(int index, Date defaultValue) getDateOrDefault(String name, Date defaultValue) getDecimal(int index) Returns the BigDecimal value of an attribute given its position.getDecimal(String name) Returns the BigDecimal value of an attribute given its name.getDecimalOrDefault(int index, BigDecimal defaultValue) getDecimalOrDefault(String name, BigDecimal defaultValue) org.gvsig.fmap.geom.primitive.EnvelopeEnvelope (AKA extent or bounding box) of the default geometry attribute.org.gvsig.fmap.geom.GeometryReturns the value of the default geometry attribute, which is aGeometry.org.gvsig.crs.projection.lib.ProjectionReturns the Spatial Reference System in which is expressed the default geometry attribute.doublegetDouble(int index) Returns the double value of an attribute given its position.doubleReturns the double value of an attribute given its name.doublegetDoubleOrDefault(int index, double defaultValue) doublegetDoubleOrDefault(String name, double defaultValue) Returns the editable instance of this Feature.org.gvsig.tools.evaluator.EvaluatorDataThis lets Feature be used eaily withEvaluatorgetExtraValue(int index) getExtraValue(String name) getFeature(int index) Returns the Feature value of an attribute given its position.getFeature(String name) Returns the Feature value of an attribute given its name.floatgetFloat(int index) Returns the float value of an attribute given its position.floatReturns the float value of an attribute given its name.floatgetFloatOrDefault(int index, float defaultValue) floatgetFloatOrDefault(String name, float defaultValue) getForeignFeature(String attrName) getFromProfile(int index) getFromProfile(String name) Returns a list with the values of this Feature's geometry attributes.org.gvsig.fmap.geom.GeometrygetGeometry(int index) Returns the Geometry value of an attribute given its position.org.gvsig.fmap.geom.GeometrygetGeometry(String name) Returns the Geometry value of an attribute given its name.intgetInt(int index) Returns the int value of an attribute given its position.intReturns the int value of an attribute given its name.intgetIntOrDefault(int index, int defaultValue) intgetIntOrDefault(String name, int defaultValue) getLabelOfValue(String name) longgetLong(int index) Returns the long value of an attribute given its position.longReturns the long value of an attribute given its name.longgetLongOrDefault(int index, long defaultValue) longgetLongOrDefault(String name, long defaultValue) getOrDefault(int index, Object defaultValue) getOrDefault(String name, int type, Object defaultValue) getOrDefault(String name, Object defaultValue) getOrDefault(String name, org.gvsig.tools.dataTypes.DataType type, Object defaultValue) Returns a unique identifier for this Feature in the associated store.getSRSs()Returns a list with the Spatial Reference Systems in which are expressed this Feature's geometry attributes.getStore()Return the store associated to this feature.getString(int index) Returns the String value of an attribute given its position.Returns the String value of an attribute given its name.getStringOrDefault(int index, String defaultValue) getStringOrDefault(String name, String defaultValue) getTime(int index) getTimestamp(int index) getTimestamp(String name) getType()Returns the FeatureType that describes the structure of this Feature.booleanhasExtraValue(String name) booleanbooleanisBroken()booleanisNull(int index) booleanvoidsetExtraValue(String name, Object value) voidvalidate(int mode) Methods inherited from interface org.gvsig.tools.util.GetKeys
getKeysMethods inherited from interface org.gvsig.tools.util.Size
sizeMethods inherited from interface org.gvsig.json.SupportToJson
toJson, toJson, toJsonBuilder, toJsonBuilder
-
Field Details
-
DATASTATUS_OK
static final int DATASTATUS_OK- See Also:
-
DATASTATUS_BROKEN
static final int DATASTATUS_BROKEN- See Also:
-
DATASTATUS_INCONSISTENT
static final int DATASTATUS_INCONSISTENT- See Also:
-
CHECK_RULES_AT_EDITING
static final int CHECK_RULES_AT_EDITING- See Also:
-
CHECK_RULES_AT_FINISH
static final int CHECK_RULES_AT_FINISH- See Also:
-
CHECK_REQUIREDS
static final int CHECK_REQUIREDS- See Also:
-
CHECK_BASIC
static final int CHECK_BASIC- See Also:
-
-
Method Details
-
getReference
FeatureReference getReference()Returns a unique identifier for this Feature in the associated store.- Returns:
- a unique FeatureReference in the associated store
-
getType
FeatureType getType()Returns the FeatureType that describes the structure of this Feature.- Returns:
- a FeatureType describing this Feature structure.
-
getCopy
Feature getCopy()Creates and returns a copy of this- Returns:
- a new instance of Feature which is equal to this
-
validate
- Throws:
DataException
-
getEditable
EditableFeature getEditable()Returns the editable instance of this Feature. EditableFeature offers methods for Feature editing.- Returns:
- EditableFeature of this
-
getOrDefault
-
getOrDefault
-
getOrDefault
-
getStringOrDefault
-
getIntOrDefault
-
getLongOrDefault
-
getFloatOrDefault
-
getDoubleOrDefault
-
getDecimalOrDefault
-
getDateOrDefault
-
getOrDefault
-
getStringOrDefault
-
getIntOrDefault
int getIntOrDefault(int index, int defaultValue) -
getLongOrDefault
long getLongOrDefault(int index, long defaultValue) -
getFloatOrDefault
float getFloatOrDefault(int index, float defaultValue) -
getDoubleOrDefault
double getDoubleOrDefault(int index, double defaultValue) -
getDecimalOrDefault
-
getDateOrDefault
-
get
Returns the value of an attribute given its name. -
get
Returns the value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
isNull
boolean isNull(int index) -
isNull
-
getInt
Returns the int value of an attribute given its name.- Parameters:
name- a string containing the name of the attribute- Returns:
- value of the specified attribute
-
getInt
int getInt(int index) Returns the int value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getBoolean
Returns the Boolean value of an attribute given its name.- Parameters:
name- name of the attribute- Returns:
- value of the specified attribute
-
getBooleanOrDefault
-
getBoolean
boolean getBoolean(int index) Returns the Boolean value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getBooleanOrDefault
boolean getBooleanOrDefault(int index, boolean defaultValue) -
getLong
Returns the long value of an attribute given its name.- Parameters:
name- name of the attribute- Returns:
- value of the specified attribute
-
getLong
long getLong(int index) Returns the long value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getFloat
Returns the float value of an attribute given its name.- Parameters:
name- name of the attribute- Returns:
- value of the specified attribute
-
getFloat
float getFloat(int index) Returns the float value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getDouble
Returns the double value of an attribute given its name.- Parameters:
name- name of the attribute- Returns:
- value of the specified attribute
-
getDouble
double getDouble(int index) Returns the double value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getDecimal
Returns the BigDecimal value of an attribute given its name.- Parameters:
name- name of the attribute- Returns:
- value of the specified attribute
-
getDecimal
Returns the BigDecimal value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getDate
Returns the Date value of an attribute given its name.- Parameters:
name- name of the attribute- Returns:
- value of the specified attribute
-
getDate
Returns the Date value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getTime
-
getTime
-
getTimestamp
-
getTimestamp
-
getString
Returns the String value of an attribute given its name.- Parameters:
name- name of the attribute- Returns:
- value of the specified attribute
-
getString
Returns the String value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getByte
Returns the byte value of an attribute given its name.- Parameters:
name- name of the attribute- Returns:
- value of the specified attribute
-
getByte
byte getByte(int index) Returns the byte value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getGeometry
Returns the Geometry value of an attribute given its name.- Parameters:
name- name of the attribute- Returns:
- value of the specified attribute
-
getGeometry
org.gvsig.fmap.geom.Geometry getGeometry(int index) Returns the Geometry value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getByteArray
-
getByteArray
byte[] getByteArray(int index) -
getArray
Returns the array value of an attribute given its name.- Parameters:
name- name of the attribute- Returns:
- value of the specified attribute
-
getArray
Returns the array value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getFeature
Returns the Feature value of an attribute given its name.- Parameters:
name- name of the attribute- Returns:
- value of the specified attribute
-
getFeature
Returns the Feature value of an attribute given its position.- Parameters:
index- position of the attribute- Returns:
- value of the specified attribute
-
getFromProfile
-
getFromProfile
-
getDefaultEnvelope
org.gvsig.fmap.geom.primitive.Envelope getDefaultEnvelope()Envelope (AKA extent or bounding box) of the default geometry attribute.- Returns:
- Envelope of the default geometry attribute
-
getDefaultGeometry
org.gvsig.fmap.geom.Geometry getDefaultGeometry()Returns the value of the default geometry attribute, which is aGeometry.- Returns:
- value of the default geometry attribute
-
getGeometries
List getGeometries()Returns a list with the values of this Feature's geometry attributes.- Returns:
- a list with the values of this Feature's geometry attributes
-
getDefaultSRS
org.gvsig.crs.projection.lib.Projection getDefaultSRS()Returns the Spatial Reference System in which is expressed the default geometry attribute.- Returns:
- A string containing the default geometry attribute SRS.
-
getSRSs
List getSRSs()Returns a list with the Spatial Reference Systems in which are expressed this Feature's geometry attributes.- Returns:
- a list with the Spatial Reference Systems.
-
getAsDynObject
org.gvsig.tools.dynobject.DynObject getAsDynObject() -
getEvaluatorData
org.gvsig.tools.evaluator.EvaluatorData getEvaluatorData()This lets Feature be used eaily withEvaluator- Returns:
- An instance of
EvaluatorDatawhich returns the data of this feature
-
getStore
FeatureStore getStore()Return the store associated to this feature.- Returns:
- the FeatureStore of the feature.
-
getLabelOfValue
-
getExtraValue
-
getExtraValue
-
hasExtraValue
-
setExtraValue
-
hasValue
-
format
-
format
-
getForeignFeature
-
createFilter
org.gvsig.expressionevaluator.Expression createFilter() -
createBuilderFilter
org.gvsig.expressionevaluator.ExpressionBuilder createBuilderFilter() -
isBroken
boolean isBroken() -
getDataStatus
int getDataStatus()
-