Class VPFFeatureClass
- Object
- 
- VPFFeatureClass
 
- 
- All Implemented Interfaces:
- SimpleFeatureType,- AttributeType,- ComplexType,- FeatureType,- PropertyType
 
 public class VPFFeatureClass extends Object implements SimpleFeatureType A VPF feature class. Note that feature classes may contain one or more feature types. However, all of the feature types of a feature class share the same schema. A feature type will therefore delegate its schema related operations to its feature class.- Author:
- Jeff Yutzler
 
- 
- 
Constructor SummaryConstructors Constructor Description VPFFeatureClass(VPFCoverage cCoverage, String cName, String cDirectoryName)ConstructorVPFFeatureClass(VPFCoverage cCoverage, String cName, String cDirectoryName, URI cNamespace)Constructor
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Equality based on propertyPropertyType.getName().intgetAttributeCount()Returns the number of attributes composing the feature typeList<AttributeDescriptor>getAttributeDescriptors()The list of attribute descriptors which make up the feature type.Class<Collection<Property>>getBinding()Override and type narrow to Collection.class. CoordinateReferenceSystemgetCoordinateReferenceSystem()The coordinate reference system of the feature.VPFCoveragegetCoverage()The coverage that owns this feature classInternationalStringgetDescription()Human readable description of this property type.AttributeDescriptorgetDescriptor(int index)Returns the attribute descriptor at the specified index.AttributeDescriptorgetDescriptor(String name)Returns the attribute descriptor which matches the specified name.AttributeDescriptorgetDescriptor(Name name)Returns the attribute descriptor which matches the specified name.Collection<PropertyDescriptor>getDescriptors()The property descriptor which compose the complex type.StringgetDirectoryName()The path to the directory that contains this feature classStringgetFCTypeName()SimpleFeatureTypegetFeatureType()List<VPFFile>getFileList()Returns a list of file objectsGeometryDescriptorgetGeometryDescriptor()Describe the default geometric attribute for this feature.VPFGeometryFactorygetGeometryFactory()NamegetName()The name of the property type.List<Filter>getRestrictions()List of restrictions used define valid values for properties of this property type.AttributeTypegetSuper()Override ofPropertyType.getSuper()which type narrows toAttributeType.AttributeTypegetType(int index)Returns the type of the attribute at the specified index.AttributeTypegetType(String name)Returns the type of the attribute which matches the specified name.AttributeTypegetType(Name name)Returns the type of the attribute which matches the specified name.StringgetTypeName()The local name for this FeatureType.List<AttributeType>getTypes()Returns the types of all the attributes which make up the feature.Map<Object,Object>getUserData()A map of "user data" which enables applications to store "application-specific" information against a property type.inthashCode()Hashcode override based onPropertyType.getName().booleanhasNext()intindexOf(String name)Returns the index of the attribute which matches the specified name.intindexOf(Name name)Returns the index of the attribute which matches the specified name.booleanisAbstract()Flag indicating if the type is abstract or not.booleanisIdentified()Features are always identified.booleanisInline()Indicates ability of XPath to notice this attribute.List<SimpleFeature>readAllRows(SimpleFeatureType featureType)SimpleFeaturereadNext(SimpleFeatureType featureType)voidreset()
 
- 
- 
- 
Constructor Detail- 
VPFFeatureClasspublic VPFFeatureClass(VPFCoverage cCoverage, String cName, String cDirectoryName) throws SchemaException Constructor- Parameters:
- cCoverage- the owning coverage
- cName- the name of the class
- cDirectoryName- the directory containing the class
- Throws:
- SchemaException- For problems making one of the feature classes as a FeatureType.
 
 - 
VPFFeatureClasspublic VPFFeatureClass(VPFCoverage cCoverage, String cName, String cDirectoryName, URI cNamespace) throws SchemaException Constructor- Parameters:
- cCoverage- the owning coverage
- cName- the name of the class
- cDirectoryName- the directory containing the class
- cNamespace- the namespace to create features with. If null then a default from VPFLibrary.DEFAULTNAMESPACE is assigned.
- Throws:
- SchemaException- For problems making one of the feature classes as a FeatureType.
 
 
- 
 - 
Method Detail- 
resetpublic void reset() 
 - 
hasNextpublic boolean hasNext() 
 - 
readAllRowspublic List<SimpleFeature> readAllRows(SimpleFeatureType featureType) throws IOException - Throws:
- IOException
 
 - 
readNextpublic SimpleFeature readNext(SimpleFeatureType featureType) 
 - 
getCoveragepublic VPFCoverage getCoverage() The coverage that owns this feature class- Returns:
- a VPFCoverageobject
 
 - 
getDirectoryNamepublic String getDirectoryName() The path to the directory that contains this feature class- Returns:
- a Stringvalue representing the path to the directory.
 
 - 
getFileListpublic List<VPFFile> getFileList() Returns a list of file objects- Returns:
- a ListcontainingVPFFileobjects.
 
 - 
getFeatureTypepublic SimpleFeatureType getFeatureType() 
 - 
getTypeNamepublic String getTypeName() Description copied from interface:SimpleFeatureTypeThe local name for this FeatureType.Specifically this method returns getName().getLocalPart().- Specified by:
- getTypeNamein interface- SimpleFeatureType
- Returns:
- The local name for this FeatureType.
 
 - 
getFCTypeNamepublic String getFCTypeName() 
 - 
getAttributeCountpublic int getAttributeCount() Description copied from interface:SimpleFeatureTypeReturns the number of attributes composing the feature typeThis method is convenience for getAttributes().size().- Specified by:
- getAttributeCountin interface- SimpleFeatureType
- Returns:
- The number of attributes.
 
 - 
isAbstractpublic boolean isAbstract() Description copied from interface:PropertyTypeFlag indicating if the type is abstract or not.- Specified by:
- isAbstractin interface- PropertyType
- Returns:
- trueif the type is abstract, otherwise- false.
 
 - 
getGeometryFactorypublic VPFGeometryFactory getGeometryFactory() - Returns:
- Returns the geometryFactory.
 
 - 
equalspublic boolean equals(Object obj) Description copied from interface:PropertyTypeEquality based on propertyPropertyType.getName().- Specified by:
- equalsin interface- PropertyType
- Overrides:
- equalsin class- Object
- Returns:
- trueif other is a PropertyType with the same name
 
 - 
hashCodepublic int hashCode() Description copied from interface:PropertyTypeHashcode override based onPropertyType.getName().- Specified by:
- hashCodein interface- PropertyType
- Overrides:
- hashCodein class- Object
- Returns:
- getName().hashCode()
 
 - 
getDescriptorpublic AttributeDescriptor getDescriptor(Name name) Description copied from interface:SimpleFeatureTypeReturns the attribute descriptor which matches the specified name.This method is convenience for: return (AttributeDescriptor) getProperty(name); This method returns nullif no such attribute exists.- Specified by:
- getDescriptorin interface- ComplexType
- Specified by:
- getDescriptorin interface- SimpleFeatureType
- Parameters:
- name- The name of the descriptor to return.
- Returns:
- The attribute descriptor matching the specified name, or nullif no such attribute exists.
 
 - 
getDescriptorpublic AttributeDescriptor getDescriptor(String name) Description copied from interface:SimpleFeatureTypeReturns the attribute descriptor which matches the specified name.This method is convenience for: return (AttributeDescriptor) getProperty(name); This method returns nullif no such attribute exists.- Specified by:
- getDescriptorin interface- ComplexType
- Specified by:
- getDescriptorin interface- SimpleFeatureType
- Parameters:
- name- The name of the descriptor to return.
- Returns:
- The attribute descriptor matching the specified name, or nullif no such attribute exists.
 
 - 
getDescriptorpublic AttributeDescriptor getDescriptor(int index) Description copied from interface:SimpleFeatureTypeReturns the attribute descriptor at the specified index.This method is convenience for: return (AttributeDescriptor) ((List) getProperties()).get(index); - Specified by:
- getDescriptorin interface- SimpleFeatureType
- Parameters:
- index- The index of the descriptor to return.
- Returns:
- The attribute descriptor at the specified index.
 
 - 
getAttributeDescriptorspublic List<AttributeDescriptor> getAttributeDescriptors() Description copied from interface:SimpleFeatureTypeThe list of attribute descriptors which make up the feature type.This method is a convenience for: return (List<AttributeDescriptor>) getProperties(); - Specified by:
- getAttributeDescriptorsin interface- SimpleFeatureType
- Returns:
- The ordered list of attribute descriptors.
 
 - 
getTypepublic AttributeType getType(Name name) Description copied from interface:SimpleFeatureTypeReturns the type of the attribute which matches the specified name.This method is convenience for: return (AttributeType) getProperty(name).getType(); If there is no such attribute which matches name, nullis returned.- Specified by:
- getTypein interface- SimpleFeatureType
- Parameters:
- name- The name of the attribute whose type to return.
- Returns:
- The attribute type matching the specified name, or null.
 
 - 
getTypepublic AttributeType getType(String name) Description copied from interface:SimpleFeatureTypeReturns the type of the attribute which matches the specified name.This method is convenience for: return (AttributeType) getProperty(name).getType(); If there is no such attribute which matches name, nullis returned.- Specified by:
- getTypein interface- SimpleFeatureType
- Parameters:
- name- The name of the attribute whose type to return.
- Returns:
- The attribute type matching the specified name, or null.
 
 - 
getTypepublic AttributeType getType(int index) Description copied from interface:SimpleFeatureTypeReturns the type of the attribute at the specified index.This method is convenience for: return (AttributeType)((List)getProperties()).get(index)).getType(); - Specified by:
- getTypein interface- SimpleFeatureType
- Parameters:
- index- The index of the attribute whose type to return.
- Returns:
- The attribute type at the specified index.
 
 - 
getTypespublic List<AttributeType> getTypes() Description copied from interface:SimpleFeatureTypeReturns the types of all the attributes which make up the feature.This method is convenience for: List types = new ArrayList(); for (Property p : getProperties()) { types.add(p.getType()); } return types;- Specified by:
- getTypesin interface- SimpleFeatureType
- Returns:
- The list of attribute types.
 
 - 
getCoordinateReferenceSystempublic CoordinateReferenceSystem getCoordinateReferenceSystem() Description copied from interface:FeatureTypeThe coordinate reference system of the feature.This value is derived from the default geometry attribute: ((GeometryType)getDefaultGeometry().getType()).getCRS(); This method will return nullin the case where no default geometric attribute is defined.- Specified by:
- getCoordinateReferenceSystemin interface- FeatureType
- Returns:
- The coordinate referencing system, or null.
 
 - 
getGeometryDescriptorpublic GeometryDescriptor getGeometryDescriptor() Description copied from interface:FeatureTypeDescribe the default geometric attribute for this feature.This method returns nullin the case where no such attribute exists.- Specified by:
- getGeometryDescriptorin interface- FeatureType
- Returns:
- The descriptor of the default geometry attribute, or null.
 
 - 
getBindingpublic Class<Collection<Property>> getBinding() Description copied from interface:ComplexTypeOverride and type narrow to Collection.class. - Specified by:
- getBindingin interface- ComplexType
- Specified by:
- getBindingin interface- PropertyType
- Returns:
- The binding of the property type.
 
 - 
getDescriptorspublic Collection<PropertyDescriptor> getDescriptors() Description copied from interface:ComplexTypeThe property descriptor which compose the complex type.A complex type can be composed of attributes and associations which means this collection returns instances of AttributeDescriptorandAssociationDescriptor.- Specified by:
- getDescriptorsin interface- ComplexType
- Returns:
- Collection of descriptors representing the composition of the complex type.
 
 - 
isInlinepublic boolean isInline() Description copied from interface:ComplexTypeIndicates ability of XPath to notice this attribute.This facility is used to "hide" an attribute from XPath searches, while the compelx contents will still be navigated no additional nesting will be considered. It will be as if the content were "folded" inline resulting in a flatter nesting structure. Construct described using Java Interfaces: 
 The above is can hold the following information:interface TestSample { String name; Listmeasurement; } interface Measurement { long timestamp; Point point; long reading; } 
 Out of the box this is represented to XPath as the following tree:[ name="survey1", measurements=( [timestamp=3,point=(2,3), reading=4200], [timestamp=9,point=(2,4), reading=445600], ) ]
 By inlining Measurement we can achive the following:root/name: survey1 root/measurement[0]/timestamp:3 root/measurement[0]/point: (2,3) root/measurement[0]/reading: 4200 root/measurement[1]/timestamp:9 root/measurement[2]/point: (2,4) root/measurement[3]/reading: 445600root/name: survey1 root/timestamp[0]:3 root/point[0]: (2,3) root/reading[0]: 4200 root/timestamp[1]:9 root/point[1]: (2,4) root/reading[1] 445600- Specified by:
- isInlinein interface- ComplexType
- Returns:
- true if attribute is to be considered transparent by XPath queries
 
 - 
getSuperpublic AttributeType getSuper() Description copied from interface:AttributeTypeOverride ofPropertyType.getSuper()which type narrows toAttributeType.- Specified by:
- getSuperin interface- AttributeType
- Specified by:
- getSuperin interface- PropertyType
- Returns:
- The parent or super type, or null.
- See Also:
- PropertyType.getSuper()
 
 - 
isIdentifiedpublic boolean isIdentified() Description copied from interface:FeatureTypeFeatures are always identified.- Specified by:
- isIdentifiedin interface- AttributeType
- Specified by:
- isIdentifiedin interface- FeatureType
- Returns:
- true
- See Also:
- Attribute.getIdentifier()
 
 - 
getDescriptionpublic InternationalString getDescription() Description copied from interface:PropertyTypeHuman readable description of this property type.- Specified by:
- getDescriptionin interface- PropertyType
- Returns:
- Human readable description of this property type.
 
 - 
getNamepublic Name getName() Description copied from interface:PropertyTypeThe name of the property type.Note that this is not the same name as Property.getName(), which is the name of the instance of the type, not the type itself.The returned name is a qualified name made up of two parts. The first a namespace uri ( Name.getNamespaceURI(), and the second a local part (Name.getLocalPart().This value is never null.- Specified by:
- getNamein interface- PropertyType
- Returns:
- The name of the property type.
 
 - 
indexOfpublic int indexOf(String name) Description copied from interface:SimpleFeatureTypeReturns the index of the attribute which matches the specified name.-1 is returned in the instance there is no attribute matching the specified name. - Specified by:
- indexOfin interface- SimpleFeatureType
- Parameters:
- name- The name of the attribute whose index to return.
- Returns:
- index of named attribute, or -1 if not found.
 
 - 
indexOfpublic int indexOf(Name name) Description copied from interface:SimpleFeatureTypeReturns the index of the attribute which matches the specified name.-1 is returned in the instance there is no attribute matching the specified name. - Specified by:
- indexOfin interface- SimpleFeatureType
- Parameters:
- name- The name of the attribute whose index to return.
- Returns:
- index of named attribute, or -1 if not found.
 
 - 
getRestrictionspublic List<Filter> getRestrictions() Description copied from interface:PropertyTypeList of restrictions used define valid values for properties of this property type.Each restriction is a Filterobject in which the property is passed through. IfFilter.evaluate(Object)returnstruethe restriction is met. Iffalseis returned then the restriction has not been met and the property should be considered invalid. Remember to check getSuper().getRestrictions() as well.This method returns an empty set in the case of no restrictions and should not return null.- Specified by:
- getRestrictionsin interface- PropertyType
- Returns:
- Listused to validate allowable values. 
 
 - 
getUserDatapublic Map<Object,Object> getUserData() Description copied from interface:PropertyTypeA map of "user data" which enables applications to store "application-specific" information against a property type.As an example, consider an application that builds a PropertyType from an xml schema. A useful bit of information to attach to the PropertyType is the original schema itself, in whatever construct it might be stored in: XSDComplexTypeDefinition complexTypeDef = ...; PropertyType type = buildPropertyType( complexTypeDef ); type.getUserData().put( XSDComplexTypeDefintion.class, complexTypeDef );- Specified by:
- getUserDatain interface- PropertyType
- Returns:
- A map of user data.
 
 
- 
 
-