org.geotools.feature.type
Class SetAttributeType

Object
  extended by PropertyDescriptorImpl
      extended by AttributeDescriptorImpl
          extended by SetAttributeType
All Implemented Interfaces:
AttributeType, AttributeDescriptor, PropertyDescriptor

Deprecated. Will be removed from Geotools 2.6.

public class SetAttributeType
extends AttributeDescriptorImpl
implements AttributeType

Represents an un-ordered Set of AttributeTypes. For SFS this should not be used. For GML this is the same as an element whose complexType contains a All of Attributes. NOTE: Some of the methods in this class has nasty order-dependant assumptions, please fix.

Author:
dzwiers
Module:
modules/library/legacy (gt-legacy.jar)

Field Summary
 
Fields inherited from class AttributeDescriptorImpl
defaultValue
 
Fields inherited from class PropertyDescriptorImpl
isNillable, maxOccurs, minOccurs, name, type
 
Fields inherited from interface AttributeType
UNBOUNDED
 
Constructor Summary
SetAttributeType(SetAttributeType copy)
          Deprecated.  
SetAttributeType(String name, boolean nillable, AttributeType[] children)
          Deprecated.  
SetAttributeType(String name, boolean nillable, int min, int max, AttributeType[] children, Filter restriction)
          Deprecated.  
 
Method Summary
 Object createDefaultValue()
          Deprecated. This method is unstable ... and does not yet check validity well.
 Object duplicate(Object src)
          Deprecated. This method is unstable ... and does not yet check validity well.
 int find(AttributeType type)
          Deprecated. Find the position of a given AttributeType.
 int find(String attName)
          Deprecated. Find the position of an AttributeType which matches the given String.
 int getAttributeCount()
          Deprecated. Returns the number of attributes at the first 'level' of the schema.
 AttributeType getAttributeType(int position)
          Deprecated. Gets the attributeType at the specified index.
 AttributeType getAttributeType(String xPath)
          Deprecated. Gets the attributeType at this xPath, if the specified attributeType does not exist then null is returned.
 AttributeType[] getAttributeTypes()
          Deprecated.  
 Class getBinding()
          Deprecated. Gets the class/type/binding for this attribute.
 String getLocalName()
          Deprecated. Returns the unqualified name of this attribute.
 Filter getRestriction()
          Deprecated. This represents a Facet in XML schema ... for example can be used to represent the max length of 20 for a string.
 boolean hasAttributeType(String xPath)
          Deprecated. This is only used twice in the whole geotools code base, and one of those is for a test, so we're removing it from the interface.
 boolean isGeometry()
          Deprecated.  
 Object parse(Object value)
          Deprecated. This method is unstable ... and does not yet check validity well.
 void validate(Object obj)
          Deprecated. This method is unstable ... and does not yet check validity well.
 
Methods inherited from class AttributeDescriptorImpl
equals, getDefaultValue, getType, hashCode, toString
 
Methods inherited from class PropertyDescriptorImpl
getMaxOccurs, getMinOccurs, getName, getUserData, isNillable
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface AttributeType
getMaxOccurs, getMinOccurs, isNillable
 
Methods inherited from interface AttributeDescriptor
getDefaultValue, getType
 
Methods inherited from interface PropertyDescriptor
getName, getUserData
 

Constructor Detail

SetAttributeType

public SetAttributeType(SetAttributeType copy)
Deprecated. 
Parameters:
copy -

SetAttributeType

public SetAttributeType(String name,
                        boolean nillable,
                        int min,
                        int max,
                        AttributeType[] children,
                        Filter restriction)
Deprecated. 

SetAttributeType

public SetAttributeType(String name,
                        boolean nillable,
                        AttributeType[] children)
Deprecated. 
Method Detail

getRestriction

public Filter getRestriction()
Deprecated. 
Description copied from interface: AttributeType
This represents a Facet in XML schema ... for example can be used to represent the max length of 20 for a string.

Specified by:
getRestriction in interface AttributeType
Returns:
Filter, or Filter.INCLUDE if no restriction is needed.

getLocalName

public String getLocalName()
Deprecated. 
Returns the unqualified name of this attribute.

This method is a replacement for PropertyDescriptor.getName() in order to resolve a naming conflict with the geoapi feature model.

Specified by:
getLocalName in interface AttributeType
Specified by:
getLocalName in interface AttributeDescriptor
Overrides:
getLocalName in class AttributeDescriptorImpl
See Also:
PropertyDescriptor.getName()

getBinding

public Class getBinding()
Deprecated. 
Gets the class/type/binding for this attribute.

This method is a replacement for AttributeDescriptor.getType() in order to resolve a naming conflict with the geoapi feature model.

Specified by:
getBinding in interface AttributeType
See Also:
AttributeDescriptor.getType()

isGeometry

public boolean isGeometry()
Deprecated. 

parse

public Object parse(Object value)
             throws IllegalArgumentException
Deprecated. 
This method is unstable ... and does not yet check validity well. TODO make this method robust This method assumes the Objects are in the order of the attributes. In the future, this should be implemented with a bubble sort type algorithm for testing each object vs each child. Bubble sort is recommended as the sample size is typically less than 25 elements, and the operation takes O(n*n) time.

Specified by:
parse in interface AttributeType
Parameters:
value - the object to attempt parsing of.
Returns:
value converted to the preferred storage of this AttributeType. If no parsing was possible then the same object is returned.
Throws:
IllegalArgumentException - if parsing is attempted and is unsuccessful.

validate

public void validate(Object obj)
              throws IllegalArgumentException
Deprecated. 
This method is unstable ... and does not yet check validity well. TODO make this method robust This method assumes the Objects are in the order of the attributes. In the future, this should be implemented with a bubble sort type algorithm for testing each object vs each child. Bubble sort is recommended as the sample size is typically less than 25 elements, and the operation takes O(n*n) time. Note that on the Attribute side of the fence ... this is acutally an unordered List (a Set of elements, where each element has multiplicity ...)

Specified by:
validate in interface AttributeType
Parameters:
obj - The object to be tested for validity.
Throws:
IllegalArgumentException - if the object does not validate.

duplicate

public Object duplicate(Object src)
                 throws IllegalAttributeException
Deprecated. 
This method is unstable ... and does not yet check validity well. TODO make this method robust This method assumes the Objects are in the order of the attributes. In the future, this should be implemented with a bubble sort type algorithm for testing each object vs each child. Bubble sort is recommended as the sample size is typically less than 25 elements, and the operation takes O(n*n) time.

Specified by:
duplicate in interface AttributeType
Parameters:
src - The Object to duplicate.
Returns:
Duplicate of provided object
Throws:
IllegalAttributeException - If the src Object is not the correct type.

createDefaultValue

public Object createDefaultValue()
Deprecated. 
This method is unstable ... and does not yet check validity well. TODO make this method robust This method assumes the Objects are in the order of the attributes. In the future, this should be implemented with a bubble sort type algorithm for testing each object vs each child. Bubble sort is recommended as the sample size is typically less than 25 elements, and the operation takes O(n*n) time.

Specified by:
createDefaultValue in interface AttributeType
Returns:
Default value, note may be null if isNillable is true

hasAttributeType

public boolean hasAttributeType(String xPath)
Deprecated. 
This is only used twice in the whole geotools code base, and one of those is for a test, so we're removing it from the interface. If getAttributeType does not have the AttributeType it will just return null. Gets the number of occurrences of this attribute.

Parameters:
xPath - XPath pointer to attribute type.
Returns:
Number of occurrences.

getAttributeCount

public int getAttributeCount()
Deprecated. 
Returns the number of attributes at the first 'level' of the schema.

Returns:
equivalent value to getAttributeTypes().length

getAttributeType

public AttributeType getAttributeType(String xPath)
Deprecated. 
Gets the attributeType at this xPath, if the specified attributeType does not exist then null is returned.

Parameters:
xPath - XPath pointer to attribute type.
Returns:
True if attribute exists.

find

public int find(AttributeType type)
Deprecated. 
Find the position of a given AttributeType.

Parameters:
type - The type to search for.
Returns:
-1 if not found, a zero-based index if found.

find

public int find(String attName)
Deprecated. 
Find the position of an AttributeType which matches the given String.

Parameters:
attName - the name to look for
Returns:
-1 if not found, zero-based index otherwise

getAttributeType

public AttributeType getAttributeType(int position)
Deprecated. 
Gets the attributeType at the specified index.

Parameters:
position - the position of the attribute to check.
Returns:
The attribute type at the specified position.

getAttributeTypes

public AttributeType[] getAttributeTypes()
Deprecated. 


Copyright © 1996-2009 Geotools. All Rights Reserved.