Package org.gvsig.fmap.dal.feature
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:
-
FeatureAttributeDescriptor(s) -
FeatureRule(s) - Its size
- Its SRS(s)
- Its identifier
- Whether features of this type have an OID or not (identifier assigned by the store).
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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Predicate<FeatureAttributeDescriptor> static final Predicate<FeatureAttributeDescriptor> Fields inherited from interface org.gvsig.tools.util.GetItemWithSizeAndIterator
EMPTY_GETITEMWITHSIZEANDITERATORFields inherited from interface org.gvsig.tools.util.UnmodifiableBasicList
EMPTY_UNMODIFIABLEBASICLIST -
Method Summary
Modifier and TypeMethodDescriptionbooleanIncicates if attibutes with automatic values are allowed in the sourcevoidcopyFrom(FeatureType other) get(int index) Returns an attribute descriptor given its indexReturns an attribute descriptor given its name.getAttributeDescriptor(int index) Returns aFeatureAttributeDescriptorgiven the attribute index.getAttributeDescriptor(String name) Returns aFeatureAttributeDescriptorgiven the attribute name, or null if an attribute with the given name does not exist.Returns an Array of the FeatureAttributeDescriptorgetAttributeName(int index) Returns the name of the given the attribute index.getCopy()Returns a new copy of this FeatureTypeReturns the default geometry FeatureAttributeDescriptor.intReturns the index of the attribute that will be used as default geometry attribute.Returns the name of the attribute that will be used as default geometry attribute for those processes that require a geometry (for instance rendering).org.gvsig.crs.projection.lib.ProjectionReturns the SRS in which the default geometry attribute is expressed.Returns the default time FeatureAttributeDescriptor.intReturns the index of the attribute that will be used as default geometry attribute.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 an editable instance of this FeatureType.getFilteredAttributes(Predicate<FeatureAttributeDescriptor> filter, int max) getId()Returns this FeatureType identifier.intGiven the name of an attribute, this method returns its position in this FeatureType.Return the original feature type of this type.Returns an Array of the FeatureAttributeDescriptor that compounds the primary key.getRules()Returns aFeatureRulescontaining all rules applicable to features of this type.getSRSs()Returns a list with the SRSs in which this FeatureType geometries are expressed.getStore()Return the store associated to this type.booleanIndicates whether this FeatureType has any assignedEvaluator(s).booleanhasOID()Indicates whetherFeature(s) of this FeatureType have an OID defined.booleanbooleanbooleanbooleanbooleanisEmpty()iterator()Returns an iterator over this FeatureType's attributes.intsize()Returns this FeatureType size.booleanvoidwriteAsDALFile(File file) voidwriteAsDALFile(File file, String format) Methods inherited from interface org.gvsig.tools.dynobject.DynClass
addDynMethod, getDeclaredDynMethod, getDeclaredDynMethods, getDynMethod, getDynMethod, getDynMethods, getSuperDynClasses, removeDynMethodMethods inherited from interface org.gvsig.tools.dynobject.DynStruct
addDynField, addDynFieldArray, addDynFieldBoolean, addDynFieldChoice, addDynFieldChoice, addDynFieldDate, addDynFieldDouble, addDynFieldFile, addDynFieldFloat, addDynFieldFolder, addDynFieldInt, addDynFieldList, addDynFieldLong, addDynFieldMap, addDynFieldObject, addDynFieldRange, addDynFieldRange, addDynFieldSet, addDynFieldSingle, addDynFieldSingle, addDynFieldString, addDynFieldURI, addDynFieldURL, extend, extend, extend, getDeclaredDynField, getDeclaredDynFields, getDescription, getDynField, getDynFields, getFullName, getName, getNamespace, getSuperDynStructs, isExtendable, isInstance, newInstance, remove, removeDynField, setDescription, setNamespace, validateMethods inherited from interface org.gvsig.tools.dynobject.DynStruct_v2
addDynField, getLabel, getTags, setLabelMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.gvsig.json.SupportToJson
toJson, toJson, toJsonBuilder, toJsonBuilderMethods inherited from interface org.gvsig.tools.util.UnmodifiableBasicList
toList
-
Field Details
-
BASIC_TYPES_FILTER
-
ALL_FILTER
-
-
Method Details
-
getCopy
FeatureType getCopy()Returns a new copy of this FeatureType- Returns:
- a new copy of this FeatureType
-
copyFrom
-
getRules
FeatureRules getRules()Returns aFeatureRulescontaining all rules applicable to features of this type.- Returns:
- a
FeatureRulescontaining 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
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
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:
getin interfaceorg.gvsig.tools.util.GetItem<FeatureAttributeDescriptor>- Parameters:
index- of the attribute- Returns:
- descriptor of the attribute, a
FeatureAttributeDescriptor
-
getAttributeDescriptor
Returns aFeatureAttributeDescriptorgiven the attribute name, or null if an attribute with the given name does not exist.- Parameters:
name- of the attribute- Returns:
- a
FeatureAttributeDescriptor
-
getAttributeDescriptorFromAll
-
getAttributeDescriptor
Returns aFeatureAttributeDescriptorgiven the attribute index.- Parameters:
index- of the attribute- Returns:
- a
FeatureAttributeDescriptor
-
getAttributeName
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 typeFeatureAttributeDescriptor.- Specified by:
iteratorin interfaceIterable<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:
sizein interfaceorg.gvsig.tools.util.Size- Returns:
- this FeatureType size, defined as the number of attributes it is composed of.
-
isEmpty
boolean isEmpty()- Specified by:
isEmptyin interfaceorg.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 typeGeometry.- 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 assignedEvaluator(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 whetherFeature(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
-
writeAsDALFile
-
writeAsDALFile
-
getExtraColumns
FeatureExtraColumns getExtraColumns() -
getAllAttributeDescriptors
Iterable<FeatureAttributeDescriptor> getAllAttributeDescriptors() -
isCheckFeaturesAtFinishEditing
boolean isCheckFeaturesAtFinishEditing() -
isCheckFeaturesAtInsert
boolean isCheckFeaturesAtInsert()
-