Class VPFFeatureType
- Object
-
- VPFFeatureType
-
- All Implemented Interfaces:
SimpleFeatureType
,AttributeType
,ComplexType
,FeatureType
,PropertyType
public class VPFFeatureType extends Object implements SimpleFeatureType
A VPF feature type. 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 Summary
Constructors Constructor Description VPFFeatureType(VPFFeatureClass cFeatureClass)
A constructor for feature types with no information in a char.vdt file.VPFFeatureType(VPFFeatureClass cFeatureClass, SimpleFeature cFeature)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
debugFeature(SimpleFeature feature)
static void
debugFeatureType(SimpleFeatureType featureType)
boolean
equals(Object obj)
Equality based on propertyPropertyType.getName()
.int
getAttributeCount()
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. CoordinateReferenceSystem
getCoordinateReferenceSystem()
The coordinate reference system of the feature.VPFCoverage
getCoverage()
InternationalString
getDescription()
Human readable description of this property type.AttributeDescriptor
getDescriptor(int index)
Returns the attribute descriptor at the specified index.AttributeDescriptor
getDescriptor(String name)
Returns the attribute descriptor which matches the specified name.AttributeDescriptor
getDescriptor(Name name)
Returns the attribute descriptor which matches the specified name.Collection<PropertyDescriptor>
getDescriptors()
The property descriptor which compose the complex type.String
getDirectoryName()
String
getFaccCode()
The FACC code, a two-letter, 3-number code identifying the feature typeVPFFeatureClass
getFeatureClass()
List
getFileList()
Returns a list of file objectsGeometryDescriptor
getGeometryDescriptor()
Describe the default geometric attribute for this feature.Name
getName()
The name of the property type.List<Filter>
getRestrictions()
List of restrictions used define valid values for properties of this property type.AttributeType
getSuper()
Override ofPropertyType.getSuper()
which type narrows toAttributeType
.AttributeType
getType(int index)
Returns the type of the attribute at the specified index.AttributeType
getType(String name)
Returns the type of the attribute which matches the specified name.AttributeType
getType(Name name)
Returns the type of the attribute which matches the specified name.String
getTypeName()
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.int
hashCode()
Hashcode override based onPropertyType.getName()
.int
indexOf(String name)
Returns the index of the attribute which matches the specified name.int
indexOf(Name name)
Returns the index of the attribute which matches the specified name.boolean
isAbstract()
Flag indicating if the type is abstract or not.boolean
isIdentified()
Features are always identified.boolean
isInline()
Indicates ability of XPath to notice this attribute.List<SimpleFeature>
readAllRows()
-
-
-
Constructor Detail
-
VPFFeatureType
public VPFFeatureType(VPFFeatureClass cFeatureClass, SimpleFeature cFeature)
Constructor- Parameters:
cFeatureClass
- The owning feature classcFeature
- AFeature
from the CHAR.VDT file with more detailed information for this feature type
-
VPFFeatureType
public VPFFeatureType(VPFFeatureClass cFeatureClass)
A constructor for feature types with no information in a char.vdt file.- Parameters:
cFeatureClass
- The owning feature class
-
-
Method Detail
-
debugFeature
public static void debugFeature(SimpleFeature feature)
-
debugFeatureType
public static void debugFeatureType(SimpleFeatureType featureType)
-
getAttributeCount
public int getAttributeCount()
Description copied from interface:SimpleFeatureType
Returns the number of attributes composing the feature typeThis method is convenience for
getAttributes().size()
.- Specified by:
getAttributeCount
in interfaceSimpleFeatureType
- Returns:
- The number of attributes.
-
getCoverage
public VPFCoverage getCoverage()
- Returns:
- The
VPFCoverage
that thisFeatureType
belongs to.
-
getDirectoryName
public String getDirectoryName()
- Returns:
- The
String
path for the directory containing theVPFFeatureClass
that thisFeatureType
belongs to.
-
getFeatureClass
public VPFFeatureClass getFeatureClass()
- Returns:
- Returns the featureClass.
-
readAllRows
public List<SimpleFeature> readAllRows() throws IOException
- Throws:
IOException
-
getFileList
public List getFileList()
Returns a list of file objects- Returns:
- A
List
containingVPFFile
objects.
-
getTypeName
public String getTypeName()
Description copied from interface:SimpleFeatureType
The local name for this FeatureType.Specifically this method returns
getName().getLocalPart().
- Specified by:
getTypeName
in interfaceSimpleFeatureType
- Returns:
- A
List
containing theColumnPair
objects which identify the file joins for theVPFFeatureClass
that thisFeatureType
belongs to.
-
isAbstract
public boolean isAbstract()
Description copied from interface:PropertyType
Flag indicating if the type is abstract or not.- Specified by:
isAbstract
in interfacePropertyType
- Returns:
true
if the type is abstract, otherwisefalse
.
-
getFaccCode
public String getFaccCode()
The FACC code, a two-letter, 3-number code identifying the feature type- Returns:
- Returns the FACC Code.
-
equals
public boolean equals(Object obj)
Description copied from interface:PropertyType
Equality based on propertyPropertyType.getName()
.- Specified by:
equals
in interfacePropertyType
- Overrides:
equals
in classObject
- Returns:
true
if other is a PropertyType with the same name
-
hashCode
public int hashCode()
Description copied from interface:PropertyType
Hashcode override based onPropertyType.getName()
.- Specified by:
hashCode
in interfacePropertyType
- Overrides:
hashCode
in classObject
- Returns:
- getName().hashCode()
-
getDescriptor
public AttributeDescriptor getDescriptor(int index)
Description copied from interface:SimpleFeatureType
Returns the attribute descriptor at the specified index.This method is convenience for:
return (AttributeDescriptor) ((List) getProperties()).get(index);
- Specified by:
getDescriptor
in interfaceSimpleFeatureType
- Parameters:
index
- The index of the descriptor to return.- Returns:
- The attribute descriptor at the specified index.
-
getAttributeDescriptors
public List<AttributeDescriptor> getAttributeDescriptors()
Description copied from interface:SimpleFeatureType
The list of attribute descriptors which make up the feature type.This method is a convenience for:
return (List<AttributeDescriptor>) getProperties();
- Specified by:
getAttributeDescriptors
in interfaceSimpleFeatureType
- Returns:
- The ordered list of attribute descriptors.
-
getDescriptor
public AttributeDescriptor getDescriptor(Name name)
Description copied from interface:SimpleFeatureType
Returns the attribute descriptor which matches the specified name.This method is convenience for:
return (AttributeDescriptor) getProperty(name);
This method returns
null
if no such attribute exists.- Specified by:
getDescriptor
in interfaceComplexType
- Specified by:
getDescriptor
in interfaceSimpleFeatureType
- Parameters:
name
- The name of the descriptor to return.- Returns:
- The attribute descriptor matching the specified name, or
null
if no such attribute exists.
-
getDescriptor
public AttributeDescriptor getDescriptor(String name)
Description copied from interface:SimpleFeatureType
Returns the attribute descriptor which matches the specified name.This method is convenience for:
return (AttributeDescriptor) getProperty(name);
This method returns
null
if no such attribute exists.- Specified by:
getDescriptor
in interfaceComplexType
- Specified by:
getDescriptor
in interfaceSimpleFeatureType
- Parameters:
name
- The name of the descriptor to return.- Returns:
- The attribute descriptor matching the specified name, or
null
if no such attribute exists.
-
getType
public AttributeType getType(Name name)
Description copied from interface:SimpleFeatureType
Returns 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,
null
is returned.- Specified by:
getType
in interfaceSimpleFeatureType
- Parameters:
name
- The name of the attribute whose type to return.- Returns:
- The attribute type matching the specified name, or
null
.
-
getType
public AttributeType getType(String name)
Description copied from interface:SimpleFeatureType
Returns 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,
null
is returned.- Specified by:
getType
in interfaceSimpleFeatureType
- Parameters:
name
- The name of the attribute whose type to return.- Returns:
- The attribute type matching the specified name, or
null
.
-
getType
public AttributeType getType(int index)
Description copied from interface:SimpleFeatureType
Returns the type of the attribute at the specified index.This method is convenience for:
return (AttributeType)((List)getProperties()).get(index)).getType();
- Specified by:
getType
in interfaceSimpleFeatureType
- Parameters:
index
- The index of the attribute whose type to return.- Returns:
- The attribute type at the specified index.
-
getTypes
public List<AttributeType> getTypes()
Description copied from interface:SimpleFeatureType
Returns 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:
getTypes
in interfaceSimpleFeatureType
- Returns:
- The list of attribute types.
-
getCoordinateReferenceSystem
public CoordinateReferenceSystem getCoordinateReferenceSystem()
Description copied from interface:FeatureType
The coordinate reference system of the feature.This value is derived from the default geometry attribute:
((GeometryType)getDefaultGeometry().getType()).getCRS();
This method will return
null
in the case where no default geometric attribute is defined.- Specified by:
getCoordinateReferenceSystem
in interfaceFeatureType
- Returns:
- The coordinate referencing system, or
null
.
-
getGeometryDescriptor
public GeometryDescriptor getGeometryDescriptor()
Description copied from interface:FeatureType
Describe the default geometric attribute for this feature.This method returns
null
in the case where no such attribute exists.- Specified by:
getGeometryDescriptor
in interfaceFeatureType
- Returns:
- The descriptor of the default geometry attribute, or
null
.
-
getBinding
public Class<Collection<Property>> getBinding()
Description copied from interface:ComplexType
Override and type narrow to Collection.class. - Specified by:
getBinding
in interfaceComplexType
- Specified by:
getBinding
in interfacePropertyType
- Returns:
- The binding of the property type.
-
getDescriptors
public Collection<PropertyDescriptor> getDescriptors()
Description copied from interface:ComplexType
The property descriptor which compose the complex type.A complex type can be composed of attributes and associations which means this collection returns instances of
AttributeDescriptor
andAssociationDescriptor
.- Specified by:
getDescriptors
in interfaceComplexType
- Returns:
- Collection of descriptors representing the composition of the complex type.
-
isInline
public boolean isInline()
Description copied from interface:ComplexType
Indicates 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; List
measurement; } 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: 445600
root/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:
isInline
in interfaceComplexType
- Returns:
- true if attribute is to be considered transparent by XPath queries
-
getRestrictions
public List<Filter> getRestrictions()
Description copied from interface:PropertyType
List of restrictions used define valid values for properties of this property type.Each restriction is a
Filter
object in which the property is passed through. IfFilter.evaluate(Object)
returnstrue
the restriction is met. Iffalse
is 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:
getRestrictions
in interfacePropertyType
- Returns:
- List
used to validate allowable values.
-
getSuper
public AttributeType getSuper()
Description copied from interface:AttributeType
Override ofPropertyType.getSuper()
which type narrows toAttributeType
.- Specified by:
getSuper
in interfaceAttributeType
- Specified by:
getSuper
in interfacePropertyType
- Returns:
- The parent or super type, or
null
. - See Also:
PropertyType.getSuper()
-
isIdentified
public boolean isIdentified()
Description copied from interface:FeatureType
Features are always identified.- Specified by:
isIdentified
in interfaceAttributeType
- Specified by:
isIdentified
in interfaceFeatureType
- Returns:
true
- See Also:
Attribute#getID()
-
getDescription
public InternationalString getDescription()
Description copied from interface:PropertyType
Human readable description of this property type.- Specified by:
getDescription
in interfacePropertyType
- Returns:
- Human readable description of this property type.
-
getName
public Name getName()
Description copied from interface:PropertyType
The 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:
getName
in interfacePropertyType
- Returns:
- The name of the property type.
-
getUserData
public Map<Object,Object> getUserData()
Description copied from interface:PropertyType
A 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:
getUserData
in interfacePropertyType
- Returns:
- A map of user data.
-
indexOf
public int indexOf(String name)
Description copied from interface:SimpleFeatureType
Returns 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:
indexOf
in interfaceSimpleFeatureType
- Parameters:
name
- The name of the attribute whose index to return.- Returns:
- index of named attribute, or -1 if not found.
-
indexOf
public int indexOf(Name name)
Description copied from interface:SimpleFeatureType
Returns 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:
indexOf
in interfaceSimpleFeatureType
- Parameters:
name
- The name of the attribute whose index to return.- Returns:
- index of named attribute, or -1 if not found.
-
-