public class VPFFeatureType extends Object implements SimpleFeatureType
Constructor and Description |
---|
VPFFeatureType(VPFFeatureClass cFeatureClass)
A constructor for feature types with no information in a char.vdt file.
|
VPFFeatureType(VPFFeatureClass cFeatureClass,
SimpleFeature cFeature)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static void |
debugFeature(SimpleFeature feature) |
static void |
debugFeatureType(SimpleFeatureType featureType) |
boolean |
equals(Object obj)
Equality based on property
PropertyType.getName() . |
int |
getAttributeCount()
Returns the number of attributes composing the feature type
This method is convenience for
getAttributes().size() . |
List<AttributeDescriptor> |
getAttributeDescriptors()
The list of attribute descriptors which make up the feature type.
|
Class<Collection<Property>> |
getBinding()
Override and type narrow to Collection
|
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(Name name)
Returns the attribute descriptor which matches the specified name.
|
AttributeDescriptor |
getDescriptor(String 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 type
|
VPFFeatureClass |
getFeatureClass() |
List |
getFileList()
Returns a list of file objects
|
GeometryDescriptor |
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 of
PropertyType.getSuper() which type narrows to AttributeType . |
AttributeType |
getType(int index)
Returns the type of the attribute at the specified index.
|
AttributeType |
getType(Name name)
Returns the type of the attribute which matches the specified name.
|
AttributeType |
getType(String 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 on
PropertyType.getName() . |
int |
indexOf(Name name)
Returns the index of the attribute which matches the specified name.
|
int |
indexOf(String 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() |
public VPFFeatureType(VPFFeatureClass cFeatureClass, SimpleFeature cFeature)
cFeatureClass
- The owning feature classcFeature
- A Feature
from the CHAR.VDT file with more detailed information
for this feature typepublic VPFFeatureType(VPFFeatureClass cFeatureClass)
cFeatureClass
- The owning feature classpublic static void debugFeature(SimpleFeature feature)
public static void debugFeatureType(SimpleFeatureType featureType)
public int getAttributeCount()
SimpleFeatureType
This method is convenience for getAttributes().size()
.
getAttributeCount
in interface SimpleFeatureType
public VPFCoverage getCoverage()
VPFCoverage
that this FeatureType
belongs to.public String getDirectoryName()
String
path for the directory containing the VPFFeatureClass
that this FeatureType
belongs to.public VPFFeatureClass getFeatureClass()
public List<SimpleFeature> readAllRows() throws IOException
IOException
public List getFileList()
List
containing VPFFile
objects.public String getTypeName()
SimpleFeatureType
Specifically this method returns getName().getLocalPart().
getTypeName
in interface SimpleFeatureType
List
containing the ColumnPair
objects which identify the
file joins for the VPFFeatureClass
that this FeatureType
belongs to.public boolean isAbstract()
PropertyType
isAbstract
in interface PropertyType
true
if the type is abstract, otherwise false
.public String getFaccCode()
public boolean equals(Object obj)
PropertyType
PropertyType.getName()
.equals
in interface PropertyType
equals
in class Object
true
if other is a PropertyType with the same namepublic int hashCode()
PropertyType
PropertyType.getName()
.hashCode
in interface PropertyType
hashCode
in class Object
public AttributeDescriptor getDescriptor(int index)
SimpleFeatureType
This method is convenience for:
return (AttributeDescriptor) ((List) getProperties()).get(index);
getDescriptor
in interface SimpleFeatureType
index
- The index of the descriptor to return.public List<AttributeDescriptor> getAttributeDescriptors()
SimpleFeatureType
This method is a convenience for:
return (List<AttributeDescriptor>) getProperties();
getAttributeDescriptors
in interface SimpleFeatureType
public AttributeDescriptor getDescriptor(Name name)
SimpleFeatureType
This method is convenience for:
return (AttributeDescriptor) getProperty(name);
This method returns null
if no such attribute exists.
getDescriptor
in interface SimpleFeatureType
getDescriptor
in interface ComplexType
name
- The name of the descriptor to return.null
if no such
attribute exists.public AttributeDescriptor getDescriptor(String name)
SimpleFeatureType
This method is convenience for:
return (AttributeDescriptor) getProperty(name);
This method returns null
if no such attribute exists.
getDescriptor
in interface SimpleFeatureType
getDescriptor
in interface ComplexType
name
- The name of the descriptor to return.null
if no such
attribute exists.public AttributeType getType(Name name)
SimpleFeatureType
This method is convenience for:
return (AttributeType) getProperty(name).getType();
If there is no such attribute which matches name, null
is returned.
getType
in interface SimpleFeatureType
name
- The name of the attribute whose type to return.null
.public AttributeType getType(String name)
SimpleFeatureType
This method is convenience for:
return (AttributeType) getProperty(name).getType();
If there is no such attribute which matches name, null
is returned.
getType
in interface SimpleFeatureType
name
- The name of the attribute whose type to return.null
.public AttributeType getType(int index)
SimpleFeatureType
This method is convenience for:
return (AttributeType)((List)getProperties()).get(index)).getType();
getType
in interface SimpleFeatureType
index
- The index of the attribute whose type to return.public List<AttributeType> getTypes()
SimpleFeatureType
This method is convenience for:
List types = new ArrayList(); for (Property p : getProperties()) { types.add(p.getType()); } return types;
getTypes
in interface SimpleFeatureType
public CoordinateReferenceSystem getCoordinateReferenceSystem()
FeatureType
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.
getCoordinateReferenceSystem
in interface FeatureType
null
.public GeometryDescriptor getGeometryDescriptor()
FeatureType
This method returns null
in the case where no such attribute exists.
getGeometryDescriptor
in interface FeatureType
null
.public Class<Collection<Property>> getBinding()
ComplexType
getBinding
in interface ComplexType
getBinding
in interface PropertyType
public Collection<PropertyDescriptor> getDescriptors()
ComplexType
A complex type can be composed of attributes and associations which means this collection
returns instances of AttributeDescriptor
and AssociationDescriptor
.
getDescriptors
in interface ComplexType
public boolean isInline()
ComplexType
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:
interface TestSample {
String name;
List measurement;
}
interface Measurement {
long timestamp;
Point point;
long reading;
}
The above is can hold the following information:
[ name="survey1",
measurements=(
[timestamp=3,point=(2,3), reading=4200],
[timestamp=9,point=(2,4), reading=445600],
)
]
Out of the box this is represented to XPath as the following tree:
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
By inlining Measurement we can achive the following:
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
isInline
in interface ComplexType
public List<Filter> getRestrictions()
PropertyType
Each restriction is a Filter
object in which the property is passed through. If
Filter.evaluate(Object)
returns true
the restriction is met. If
false
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
.
getRestrictions
in interface PropertyType
public AttributeType getSuper()
AttributeType
PropertyType.getSuper()
which type narrows to AttributeType
.getSuper
in interface AttributeType
getSuper
in interface PropertyType
null
.PropertyType.getSuper()
public boolean isIdentified()
FeatureType
isIdentified
in interface AttributeType
isIdentified
in interface FeatureType
true
Attribute#getID()
public InternationalString getDescription()
PropertyType
getDescription
in interface PropertyType
public Name getName()
PropertyType
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
.
getName
in interface PropertyType
public Map<Object,Object> getUserData()
PropertyType
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 );
getUserData
in interface PropertyType
public int indexOf(String name)
SimpleFeatureType
-1 is returned in the instance there is no attribute matching the specified name.
indexOf
in interface SimpleFeatureType
name
- The name of the attribute whose index to return.public int indexOf(Name name)
SimpleFeatureType
-1 is returned in the instance there is no attribute matching the specified name.
indexOf
in interface SimpleFeatureType
name
- The name of the attribute whose index to return.Copyright © 1996–2022 Geotools. All rights reserved.