org.geotools.feature.simple
Class SimpleFeatureTypeImpl

Object
  extended by PropertyTypeImpl
      extended by AttributeTypeImpl
          extended by ComplexTypeImpl
              extended by FeatureTypeImpl
                  extended by SimpleFeatureTypeImpl
All Implemented Interfaces:
SimpleFeatureType, AttributeType, ComplexType, FeatureType, PropertyType

public class SimpleFeatureTypeImpl
extends FeatureTypeImpl
implements SimpleFeatureType

Implementation fo SimpleFeatureType, subtypes must be atomic and are stored in a list.

Author:
Justin, Ben Caradoc-Davies, CSIRO Exploration and Mining

Field Summary
 
Fields inherited from class AttributeTypeImpl
identified
 
Fields inherited from class PropertyTypeImpl
binding, description, isAbstract, name, restrictions, superType, userData
 
Constructor Summary
SimpleFeatureTypeImpl(Name name, List<AttributeDescriptor> schema, GeometryDescriptor defaultGeometry, boolean isAbstract, List<Filter> restrictions, AttributeType superType, InternationalString description)
           
 
Method Summary
 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.
 AttributeDescriptor getDescriptor(int index)
          Returns the attribute descriptor at the specified index.
 AttributeDescriptor getDescriptor(Name name)
          Describe a single property by name.
 AttributeDescriptor getDescriptor(String name)
          Describe a single property by unqualified name.
 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.
 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.
 
Methods inherited from class FeatureTypeImpl
equals, getCoordinateReferenceSystem, getGeometryDescriptor, hashCode
 
Methods inherited from class ComplexTypeImpl
getBinding, getDescriptors, isInline, toString
 
Methods inherited from class AttributeTypeImpl
createDefaultValue, getSuper, isIdentified, parse
 
Methods inherited from class PropertyTypeImpl
getDescription, getName, getRestrictions, getUserData, isAbstract
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface FeatureType
getCoordinateReferenceSystem, getGeometryDescriptor, isIdentified
 
Methods inherited from interface ComplexType
getBinding, getDescriptors, isInline
 
Methods inherited from interface AttributeType
getSuper
 
Methods inherited from interface PropertyType
equals, getDescription, getName, getRestrictions, getUserData, hashCode, isAbstract
 

Constructor Detail

SimpleFeatureTypeImpl

public SimpleFeatureTypeImpl(Name name,
                             List<AttributeDescriptor> schema,
                             GeometryDescriptor defaultGeometry,
                             boolean isAbstract,
                             List<Filter> restrictions,
                             AttributeType superType,
                             InternationalString description)
Method Detail

getAttributeDescriptors

public final 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 interface SimpleFeatureType
Returns:
The ordered list of attribute descriptors.
See Also:
SimpleFeatureType.getAttributeDescriptors()

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 interface SimpleFeatureType
Returns:
The list of attribute types.

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 interface SimpleFeatureType
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 interface SimpleFeatureType
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 interface SimpleFeatureType
Parameters:
index - The index of the attribute whose type to return.
Returns:
The attribute type at the specified index.

getDescriptor

public AttributeDescriptor getDescriptor(Name name)
Description copied from interface: ComplexType
Describe a single property by name.

This method returns null if no such property is found.

Specified by:
getDescriptor in interface SimpleFeatureType
Specified by:
getDescriptor in interface ComplexType
Overrides:
getDescriptor in class ComplexTypeImpl
Parameters:
name - The name of the property to get.
Returns:
The property matching the specified name, or null.

getDescriptor

public AttributeDescriptor getDescriptor(String name)
Description copied from interface: ComplexType
Describe a single property by unqualified name.

Note: Special care should be taken when using this method in the case that two properties with the same local name but different namespace uri exist. For this reason using ComplexType.getDescriptor(Name) is safer.

This method returns null if no such property is found.

Specified by:
getDescriptor in interface SimpleFeatureType
Specified by:
getDescriptor in interface ComplexType
Overrides:
getDescriptor in class ComplexTypeImpl
Parameters:
name - The name of the property to get.
Returns:
The property matching the specified name, or null.

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 interface SimpleFeatureType
Returns:
The attribute descriptor at the specified index.

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 interface SimpleFeatureType
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(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 interface SimpleFeatureType
Parameters:
name - The name of the attribute whose index to return.
Returns:
index of named attribute, or -1 if not found.

getAttributeCount

public int getAttributeCount()
Description copied from interface: SimpleFeatureType
Returns the number of attributes composing the feature type

This method is convenience for getAttributes().size().

Specified by:
getAttributeCount in interface SimpleFeatureType
Returns:
The number of attributes.

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 interface SimpleFeatureType
Returns:
The local name for this FeatureType.


Copyright © 1996-2014 Geotools. All Rights Reserved.