Interface FeatureType

All Superinterfaces:
org.gvsig.tools.dynobject.DynClass, org.gvsig.tools.dynobject.DynStruct, org.gvsig.tools.dynobject.DynStruct_v2, org.gvsig.tools.util.GetItem<FeatureAttributeDescriptor>, org.gvsig.tools.util.GetItemWithSize<FeatureAttributeDescriptor>, org.gvsig.tools.util.GetItemWithSizeAndIterator<FeatureAttributeDescriptor>, org.gvsig.tools.util.IsEmpty, Iterable<FeatureAttributeDescriptor>, org.gvsig.tools.util.Size, org.gvsig.json.SupportToJson, org.gvsig.tools.dynobject.Tagged, org.gvsig.tools.util.UnmodifiableBasicCollection<FeatureAttributeDescriptor>, org.gvsig.tools.util.UnmodifiableBasicList<FeatureAttributeDescriptor>
All Known Subinterfaces:
EditableFeatureType

public interface FeatureType extends org.gvsig.tools.dynobject.DynClass, org.gvsig.tools.dynobject.DynStruct_v2, org.gvsig.tools.util.UnmodifiableBasicList<FeatureAttributeDescriptor>, org.gvsig.json.SupportToJson

This interface provides all the information that describes the structure of a type of feature, methods for managing it and also offers a variety of utility methods for simplicity's sake.

The relevant information that compounds a FeatureType includes:

Methods for management include:

  • Obtaining its editable instance.
  • Obtaining an iterator over its attributes.
  • Knowing whether this FeatureType has any associated evaluator for calculated attributes.

Utility methods include:

  • Getting a copy of the FeatureType.
  • Getting the default geometry attribute.
  • Getting the default spatial reference system.
  • Field Details

  • Method Details

    • getCopy

      FeatureType getCopy()
      Returns a new copy of this FeatureType
      Returns:
      a new copy of this FeatureType
    • copyFrom

      void copyFrom(FeatureType other)
    • getRules

      FeatureRules getRules()
      Returns a FeatureRules containing all rules applicable to features of this type.
      Returns:
      a FeatureRules containing all rules applicable to features of this type.
    • getEditable

      EditableFeatureType getEditable()
      Returns an editable instance of this FeatureType. Any modifications on a FeatureType must be done through its editable instance.
      Returns:
      the editable instance of this FeatureType.
      See Also:
    • getIndex

      int getIndex(String name)
      Given the name of an attribute, this method returns its position in this FeatureType.
      Parameters:
      name - of the attribute
      Returns:
      position of the attribute
    • get

      Object get(String name)
      Returns an attribute descriptor given its name.
      Parameters:
      name - of the attribute
      Returns:
      descriptor of the attribute, a FeatureAttributeDescriptor.
    • get

      Returns an attribute descriptor given its index
      Specified by:
      get in interface org.gvsig.tools.util.GetItem<FeatureAttributeDescriptor>
      Parameters:
      index - of the attribute
      Returns:
      descriptor of the attribute, a FeatureAttributeDescriptor
    • getAttributeDescriptor

      FeatureAttributeDescriptor getAttributeDescriptor(String name)
      Returns a FeatureAttributeDescriptor given the attribute name, or null if an attribute with the given name does not exist.
      Parameters:
      name - of the attribute
      Returns:
      a FeatureAttributeDescriptor
    • getAttributeDescriptorFromAll

      FeatureAttributeDescriptor getAttributeDescriptorFromAll(String name)
    • getAttributeDescriptor

      FeatureAttributeDescriptor getAttributeDescriptor(int index)
      Returns a FeatureAttributeDescriptor given the attribute index.
      Parameters:
      index - of the attribute
      Returns:
      a FeatureAttributeDescriptor
    • getAttributeName

      String getAttributeName(int index)
      Returns the name of the given the attribute index. If the index is incorrect, return null.
      Parameters:
      index - of the attribute
      Returns:
      a String with the name of attribute
    • iterator

      Iterator iterator()
      Returns an iterator over this FeatureType's attributes. Elements returned by this iterator are of type FeatureAttributeDescriptor.
      Specified by:
      iterator in interface Iterable<FeatureAttributeDescriptor>
      Returns:
      An iterator over this FeatureType's FeatureAttributeDescriptors.
    • size

      int size()
      Returns this FeatureType size. The size of a FeatureType is determined by its number of attributes.
      Specified by:
      size in interface org.gvsig.tools.util.Size
      Returns:
      this FeatureType size, defined as the number of attributes it is composed of.
    • isEmpty

      boolean isEmpty()
      Specified by:
      isEmpty in interface org.gvsig.tools.util.IsEmpty
    • getId

      String getId()
      Returns this FeatureType identifier. This identifier must always be equal to a store.
      Returns:
      the identifier.
    • getDefaultGeometryAttributeName

      String getDefaultGeometryAttributeName()
      Returns the name of the attribute that will be used as default geometry attribute for those processes that require a geometry (for instance rendering).
      Returns:
      name of the default geometry attribute.
    • getDefaultGeometryAttributeIndex

      int getDefaultGeometryAttributeIndex()
      Returns the index of the attribute that will be used as default geometry attribute.
      Returns:
      index of the default geometry attribute.
    • getSRSs

      List getSRSs()
      Returns a list with the SRSs in which this FeatureType geometries are expressed. Normally there may be one SRS for each attribute of type Geometry.
      Returns:
      a list with the SRS in which this FeatureType geometries are expressed.
    • getDefaultSRS

      org.gvsig.crs.projection.lib.Projection getDefaultSRS()
      Returns the SRS in which the default geometry attribute is expressed.
      Returns:
      the SRS in which the default geometry attribute is expressed, null if not has a default geometry attribute.
    • hasEvaluators

      boolean hasEvaluators()
      Indicates whether this FeatureType has any assigned Evaluator(s). Evaluators are used to obtain the values for calculated attributes.
      Returns:
      true if this FeatureType has any assigned Evaluator(s).
    • hasOID

      boolean hasOID()
      Indicates whether Feature(s) of this FeatureType have an OID defined. An OID is the Feature unique identifier. Some stores provide their own OIDs which are always unique (such as Postgre) while others don't support this concept and then it is the library who creates runtime ad-hoc OIDs as it see fits, but then integrity of this OIDs among different work sessions cannot be guaranteed (this is the case for shape files).
      Returns:
      true if this FeatureType has an OID defined, false otherwise.
    • allowAutomaticValues

      boolean allowAutomaticValues()
      Incicates if attibutes with automatic values are allowed in the source
      Returns:
      true if source supports this feature, false otherwise
    • getAttributeDescriptors

      FeatureAttributeDescriptor[] getAttributeDescriptors()
      Returns an Array of the FeatureAttributeDescriptor
      Returns:
    • getPrimaryKey

      FeatureAttributeDescriptor[] getPrimaryKey()
      Returns an Array of the FeatureAttributeDescriptor that compounds the primary key. If not have primary keys return a empty array.
      Returns:
    • hasPrimaryKey

      boolean hasPrimaryKey()
    • supportReferences

      boolean supportReferences()
    • getDefaultGeometryAttribute

      FeatureAttributeDescriptor getDefaultGeometryAttribute()
      Returns the default geometry FeatureAttributeDescriptor. Return null if it's not set
      Returns:
    • getDefaultTimeAttribute

      FeatureAttributeDescriptor getDefaultTimeAttribute()
      Returns the default time FeatureAttributeDescriptor. Return null if it's not set.
      Returns:
      the default time attribute
    • getDefaultTimeAttributeName

      String getDefaultTimeAttributeName()
      Returns the name of the attribute that will be used as default geometry attribute for those processes that require a geometry (for instance rendering).
      Returns:
      name of the default geometry attribute.
    • getDefaultTimeAttributeIndex

      int getDefaultTimeAttributeIndex()
      Returns the index of the attribute that will be used as default geometry attribute.
      Returns:
      index of the default geometry attribute.
    • getStore

      FeatureStore getStore()
      Return the store associated to this type.
      Returns:
      the FeatureStore of the type.
    • getFilteredAttributes

      List<FeatureAttributeDescriptor> getFilteredAttributes(Predicate<FeatureAttributeDescriptor> filter, int max)
    • getRecentUseds

      List<FeatureAttributeDescriptor> getRecentUseds()
    • getAsFeatureStore

      FeatureStore getAsFeatureStore()
    • getNewFieldName

      String getNewFieldName()
    • getOriginalFeatureType

      FeatureType getOriginalFeatureType()
      Return the original feature type of this type. It will return Null when the store it's in not editing mode or the featureType has not been change
      Returns:
      the original FeatureType of the type.
    • hasOnlyMetadataChanges

      boolean hasOnlyMetadataChanges(FeatureType other)
    • writeAsDALFile

      void writeAsDALFile(File file)
    • writeAsDALFile

      void writeAsDALFile(File file, String format)
    • getExtraColumns

      FeatureExtraColumns getExtraColumns()
    • getAllAttributeDescriptors

      Iterable<FeatureAttributeDescriptor> getAllAttributeDescriptors()
    • isCheckFeaturesAtFinishEditing

      boolean isCheckFeaturesAtFinishEditing()
    • isCheckFeaturesAtInsert

      boolean isCheckFeaturesAtInsert()