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

public interface Feature extends org.gvsig.tools.util.GetItemByKeyWithSizeAndGetKeys<String,Object>, org.gvsig.json.SupportToJson

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 FeatureReference to recognize our Feature from each other from the same data store
  • Has a FeatureType that 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 Details

  • 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

      void validate(int mode) throws DataException
      Throws:
      DataException
    • getEditable

      EditableFeature getEditable()
      Returns the editable instance of this Feature. EditableFeature offers methods for Feature editing.
      Returns:
      EditableFeature of this
    • getOrDefault

      Object getOrDefault(String name, Object defaultValue)
    • getOrDefault

      Object getOrDefault(String name, org.gvsig.tools.dataTypes.DataType type, Object defaultValue)
    • getOrDefault

      Object getOrDefault(String name, int type, Object defaultValue)
    • getStringOrDefault

      String getStringOrDefault(String name, String defaultValue)
    • getIntOrDefault

      int getIntOrDefault(String name, int defaultValue)
    • getLongOrDefault

      long getLongOrDefault(String name, long defaultValue)
    • getFloatOrDefault

      float getFloatOrDefault(String name, float defaultValue)
    • getDoubleOrDefault

      double getDoubleOrDefault(String name, double defaultValue)
    • getDecimalOrDefault

      BigDecimal getDecimalOrDefault(String name, BigDecimal defaultValue)
    • getDateOrDefault

      Date getDateOrDefault(String name, Date defaultValue)
    • getOrDefault

      Object getOrDefault(int index, Object defaultValue)
    • getStringOrDefault

      String getStringOrDefault(int index, String defaultValue)
    • 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

      BigDecimal getDecimalOrDefault(int index, BigDecimal defaultValue)
    • getDateOrDefault

      Date getDateOrDefault(int index, Date defaultValue)
    • get

      Object get(String name)
      Returns the value of an attribute given its name.
      Specified by:
      get in interface org.gvsig.tools.util.GetItemByKey<String,Object>
      Parameters:
      name - a string containing the name of the attribute
      Returns:
      value of the specified attribute
    • get

      Object get(int index)
      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

      boolean isNull(String name)
    • getInt

      int getInt(String name)
      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

      boolean getBoolean(String name)
      Returns the Boolean value of an attribute given its name.
      Parameters:
      name - name of the attribute
      Returns:
      value of the specified attribute
    • getBooleanOrDefault

      boolean getBooleanOrDefault(String name, boolean defaultValue)
    • 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

      long getLong(String name)
      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

      float getFloat(String name)
      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

      double getDouble(String name)
      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

      BigDecimal getDecimal(String name)
      Returns the BigDecimal value of an attribute given its name.
      Parameters:
      name - name of the attribute
      Returns:
      value of the specified attribute
    • getDecimal

      BigDecimal getDecimal(int index)
      Returns the BigDecimal value of an attribute given its position.
      Parameters:
      index - position of the attribute
      Returns:
      value of the specified attribute
    • getDate

      Date getDate(String name)
      Returns the Date value of an attribute given its name.
      Parameters:
      name - name of the attribute
      Returns:
      value of the specified attribute
    • getDate

      Date getDate(int index)
      Returns the Date value of an attribute given its position.
      Parameters:
      index - position of the attribute
      Returns:
      value of the specified attribute
    • getTime

      Time getTime(String name)
    • getTime

      Time getTime(int index)
    • getTimestamp

      Timestamp getTimestamp(String name)
    • getTimestamp

      Timestamp getTimestamp(int index)
    • getString

      String getString(String name)
      Returns the String value of an attribute given its name.
      Parameters:
      name - name of the attribute
      Returns:
      value of the specified attribute
    • getString

      String getString(int index)
      Returns the String value of an attribute given its position.
      Parameters:
      index - position of the attribute
      Returns:
      value of the specified attribute
    • getByte

      byte getByte(String name)
      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

      org.gvsig.fmap.geom.Geometry getGeometry(String name)
      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

      byte[] getByteArray(String name)
    • getByteArray

      byte[] getByteArray(int index)
    • getArray

      Object[] getArray(String name)
      Returns the array value of an attribute given its name.
      Parameters:
      name - name of the attribute
      Returns:
      value of the specified attribute
    • getArray

      Object[] getArray(int index)
      Returns the array value of an attribute given its position.
      Parameters:
      index - position of the attribute
      Returns:
      value of the specified attribute
    • getFeature

      Feature getFeature(String name)
      Returns the Feature value of an attribute given its name.
      Parameters:
      name - name of the attribute
      Returns:
      value of the specified attribute
    • getFeature

      Feature getFeature(int index)
      Returns the Feature value of an attribute given its position.
      Parameters:
      index - position of the attribute
      Returns:
      value of the specified attribute
    • getFromProfile

      Object getFromProfile(int index)
    • getFromProfile

      Object getFromProfile(String name)
    • 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 a Geometry.
      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 with Evaluator
      Returns:
      An instance of EvaluatorData which returns the data of this feature
    • getStore

      FeatureStore getStore()
      Return the store associated to this feature.
      Returns:
      the FeatureStore of the feature.
    • getLabelOfValue

      String getLabelOfValue(String name)
    • getExtraValue

      Object getExtraValue(int index)
    • getExtraValue

      Object getExtraValue(String name)
    • hasExtraValue

      boolean hasExtraValue(String name)
    • setExtraValue

      void setExtraValue(String name, Object value)
    • hasValue

      boolean hasValue(String name)
    • format

      String format(String name)
    • format

      String format(int index)
    • getForeignFeature

      Feature getForeignFeature(String attrName)
    • createFilter

      org.gvsig.expressionevaluator.Expression createFilter()
    • createBuilderFilter

      org.gvsig.expressionevaluator.ExpressionBuilder createBuilderFilter()
    • isBroken

      boolean isBroken()
    • getDataStatus

      int getDataStatus()