org.geotools.feature.type
Class UniqueNameFeatureTypeImpl

Object
  extended by PropertyTypeImpl
      extended by AttributeTypeImpl
          extended by ComplexTypeImpl
              extended by FeatureTypeImpl
                  extended by UniqueNameFeatureTypeImpl
All Implemented Interfaces:
AttributeType, ComplexType, FeatureType, PropertyType
Direct Known Subclasses:
ComplexFeatureTypeImpl

public class UniqueNameFeatureTypeImpl
extends FeatureTypeImpl

A specialisation of FeatureTypeImpl that avoids equality tests on feature types with cyclic definitions by considering features types to be equal if and only if their names are equal.

Users of this class must not create multiple instances with the same name unless they represent the same type, because other parts of the implementation will assume they are equal, and if they are not, Bad Things Will Happen.

It should be noted that app-schema does not support the multiple definition XSD types with the same name. This restriction allows multiple XSD elements and thus WFS feature types (with different names) to have the same XSD type, because the XSD type can be recognised by name even if it has a cyclic definition. This simplified equality testing allows FeatureTypeCache to handle these types, despite their cyclic definition preventing a full recursive implementation of equals(Object)equals(). Unit test coverage is in GeoServer app-schema-test DuplicateTypeTest.

Author:
Ben Caradoc-Davies (CSIRO Earth Science and Resource Engineering)
See Also:
GEOT-3354

Field Summary
 
Fields inherited from class AttributeTypeImpl
identified
 
Fields inherited from class PropertyTypeImpl
binding, description, isAbstract, name, restrictions, superType, userData
 
Constructor Summary
UniqueNameFeatureTypeImpl(Name name, Collection<PropertyDescriptor> schema, GeometryDescriptor defaultGeometry, boolean isAbstract, List<Filter> restrictions, AttributeType superType, InternationalString description)
           
 
Method Summary
 boolean equals(Object other)
          Delegates to the type name Name.equals(Object).
 int hashCode()
          Delegates to type name Name.hashCode().
 
Methods inherited from class FeatureTypeImpl
getCoordinateReferenceSystem, getGeometryDescriptor
 
Methods inherited from class ComplexTypeImpl
getBinding, getDescriptor, getDescriptor, 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
isIdentified
 
Methods inherited from interface ComplexType
getBinding, getDescriptor, getDescriptor, getDescriptors, isInline
 
Methods inherited from interface AttributeType
getSuper
 
Methods inherited from interface PropertyType
getDescription, getName, getRestrictions, getUserData, isAbstract
 

Constructor Detail

UniqueNameFeatureTypeImpl

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

hashCode

public int hashCode()
Delegates to type name Name.hashCode().

Specified by:
hashCode in interface PropertyType
Overrides:
hashCode in class FeatureTypeImpl
Returns:
getName().hashCode()
See Also:
FeatureTypeImpl.hashCode()

equals

public boolean equals(Object other)
Delegates to the type name Name.equals(Object).

Specified by:
equals in interface PropertyType
Overrides:
equals in class FeatureTypeImpl
Parameters:
other - the object to be tested for equality.
Returns:
whether other is equal to this attribute Type.
See Also:
FeatureTypeImpl.equals(java.lang.Object)


Copyright © 1996-2014 Geotools. All Rights Reserved.