org.geotools.feature
Class ComplexAttributeImpl

Object
  extended by PropertyImpl
      extended by AttributeImpl
          extended by ComplexAttributeImpl
All Implemented Interfaces:
Attribute, ComplexAttribute, Property
Direct Known Subclasses:
FeatureImpl

public class ComplexAttributeImpl
extends AttributeImpl
implements ComplexAttribute


Field Summary
 
Fields inherited from class AttributeImpl
id
 
Fields inherited from class PropertyImpl
descriptor, userData, value
 
Constructor Summary
ComplexAttributeImpl(Collection<Property> properties, AttributeDescriptor descriptor, Identifier id)
           
ComplexAttributeImpl(Collection<Property> properties, ComplexType type, Identifier id)
           
 
Method Summary
 Collection<Property> getProperties()
          Complete collection of properties.
 Collection<Property> getProperties(Name name)
          Returns a subset of the properties of the complex attribute which match the specified name.
 Collection<Property> getProperties(String name)
          Returns a subset of the properties of the complex attribute which match the specified name.
 Property getProperty(Name name)
          Returns single property of the complex attribute which matches the specified name.
 Property getProperty(String name)
          Returns single property of the complex attribute which matches the specified name.
 ComplexType getType()
          The type of the property.
 Collection<? extends Property> getValue()
          The value or content of the property.
protected  Collection properties()
          Internal helper method for getting at the properties without wrapping in unmodifiable collection.
 void setValue(Collection<Property> newValue)
          Sets the contained properties of the complex attribute.
 void setValue(Object newValue)
          Override of setValue to convert the newValue to specified type if need be.
 
Methods inherited from class AttributeImpl
equals, getDescriptor, getIdentifier, hashCode, parse, toString, validate
 
Methods inherited from class PropertyImpl
getName, getUserData, isNillable
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ComplexAttribute
validate
 
Methods inherited from interface Attribute
getDescriptor, getIdentifier
 
Methods inherited from interface Property
getName, getUserData, isNillable
 

Constructor Detail

ComplexAttributeImpl

public ComplexAttributeImpl(Collection<Property> properties,
                            AttributeDescriptor descriptor,
                            Identifier id)

ComplexAttributeImpl

public ComplexAttributeImpl(Collection<Property> properties,
                            ComplexType type,
                            Identifier id)
Method Detail

getType

public ComplexType getType()
Description copied from interface: Property
The type of the property.

The type contains information about the value or content of the property such as its java class.

This value is also available via getDescriptor().getType().

Specified by:
getType in interface Attribute
Specified by:
getType in interface ComplexAttribute
Specified by:
getType in interface Property
Overrides:
getType in class AttributeImpl
Returns:
The property type.
See Also:
Property.getType()

getValue

public Collection<? extends Property> getValue()
Description copied from interface: Property
The value or content of the property.

The class of this object is defined by getType().getBinding().

This value may be null. In this case getDescriptor().isNillable() would be true.

Specified by:
getValue in interface ComplexAttribute
Specified by:
getValue in interface Property
Overrides:
getValue in class PropertyImpl
Returns:
The value of the property.

getProperties

public Collection<Property> getProperties()
Description copied from interface: ComplexAttribute
Complete collection of properties.

This method is a convenience method for calling (Collection) getValue().

Specified by:
getProperties in interface ComplexAttribute
Returns:
The complete collection of properties.

properties

protected Collection properties()
Internal helper method for getting at the properties without wrapping in unmodifiable collection.


getProperties

public Collection<Property> getProperties(Name name)
Description copied from interface: ComplexAttribute
Returns a subset of the properties of the complex attribute which match the specified name.

The name parameter is matched against each contained Property.getName(), those that are equal are returned.

Specified by:
getProperties in interface ComplexAttribute
Parameters:
name - The name of the properties to return.
Returns:
The collection of properties which match the specified name, or an empty collection if no such properties match.

getProperties

public Collection<Property> getProperties(String name)
Description copied from interface: ComplexAttribute
Returns a subset of the properties of the complex attribute which match the specified name.

This method is a convenience for ComplexAttribute.getProperties(Name) in which Name.getNamespaceURI() is null.

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 ComplexAttribute.getProperties(Name) is safer.

Specified by:
getProperties in interface ComplexAttribute
Parameters:
name - The local name of the properties to return.
Returns:
The collection of properties which match the specified name, or an empty collection if no such properties match.
See Also:
ComplexAttribute.getProperties(Name)

getProperty

public Property getProperty(Name name)
Description copied from interface: ComplexAttribute
Returns single property of the complex attribute which matches the specified name.

Note: This method is a convenience and care should be taken when calling it if more then a single property matches name. In such a case the first encountered property in which Property.getName() is equal to name is returned, and no order is guaranteed.

This method is a safe convenience for: getProperties(name).iterator().next(). In the event that no property matches the specified name null is returned.

Specified by:
getProperty in interface ComplexAttribute
Parameters:
name - The name of the property to return.
Returns:
The property matching the specified name, or null.

getProperty

public Property getProperty(String name)
Description copied from interface: ComplexAttribute
Returns single property of the complex attribute which matches the specified name.

This method is a convenience for ComplexAttribute.getProperty(Name) in which Name.getNamespaceURI() is null.

Note: This method is a convenience and care should be taken when calling it if more then a single property matches name. In such a case the first encountered property in which Property.getName() is matches name is returned, and no order is guaranteed.

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 ComplexAttribute.getProperties(Name) is safer.

Specified by:
getProperty in interface ComplexAttribute
Parameters:
name - The local name of the property to return.
Returns:
The property matching the specified name, or null.

setValue

public void setValue(Object newValue)
              throws IllegalArgumentException,
                     IllegalStateException
Description copied from class: AttributeImpl
Override of setValue to convert the newValue to specified type if need be.

Specified by:
setValue in interface Property
Overrides:
setValue in class AttributeImpl
Parameters:
newValue - The new value of the property.
Throws:
IllegalArgumentException
IllegalStateException

setValue

public void setValue(Collection<Property> newValue)
Description copied from interface: ComplexAttribute
Sets the contained properties of the complex attribute.

The values should match the structure defined by getDescriptor().

Specified by:
setValue in interface ComplexAttribute


Copyright © 1996-2014 Geotools. All Rights Reserved.