org.geotools.feature
Class AttributeImpl

java.lang.Object
  extended by org.geotools.feature.PropertyImpl
      extended by org.geotools.feature.AttributeImpl
All Implemented Interfaces:
org.opengis.feature.Attribute, org.opengis.feature.Property
Direct Known Subclasses:
ComplexAttributeImpl, GeometryAttributeImpl

public class AttributeImpl
extends PropertyImpl
implements org.opengis.feature.Attribute

Simple, mutable class to store attributes.

Version:
$Id: AttributeImpl.java 34126 2009-10-12 06:35:18Z mbedward $
Author:
Rob Hranac, VFNY, Chris Holmes, TOPP, Ian Schneider, Jody Garnett, Gabriel Roldan

Field Summary
protected  org.opengis.filter.identity.Identifier id
          id of the attribute.
 
Fields inherited from class org.geotools.feature.PropertyImpl
descriptor, userData, value
 
Constructor Summary
AttributeImpl(java.lang.Object content, org.opengis.feature.type.AttributeDescriptor descriptor, org.opengis.filter.identity.Identifier id)
           
AttributeImpl(java.lang.Object content, org.opengis.feature.type.AttributeType type, org.opengis.filter.identity.Identifier id)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Override of equals.
 org.opengis.feature.type.AttributeDescriptor getDescriptor()
           
 org.opengis.filter.identity.Identifier getIdentifier()
           
 org.opengis.feature.type.AttributeType getType()
           
 int hashCode()
          Override of hashCode.
protected  java.lang.Object parse(java.lang.Object value)
          Allows this Attribute to convert an argument to its prefered storage type.
 void setValue(java.lang.Object newValue)
          Override of setValue to convert the newValue to specified type if need be.
 java.lang.String toString()
           
 void validate()
           
 
Methods inherited from class org.geotools.feature.PropertyImpl
getName, getUserData, getValue, isNillable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengis.feature.Property
getName, getUserData, getValue, isNillable
 

Field Detail

id

protected org.opengis.filter.identity.Identifier id
id of the attribute.

Constructor Detail

AttributeImpl

public AttributeImpl(java.lang.Object content,
                     org.opengis.feature.type.AttributeDescriptor descriptor,
                     org.opengis.filter.identity.Identifier id)

AttributeImpl

public AttributeImpl(java.lang.Object content,
                     org.opengis.feature.type.AttributeType type,
                     org.opengis.filter.identity.Identifier id)
Method Detail

getIdentifier

public org.opengis.filter.identity.Identifier getIdentifier()
Specified by:
getIdentifier in interface org.opengis.feature.Attribute

getDescriptor

public org.opengis.feature.type.AttributeDescriptor getDescriptor()
Specified by:
getDescriptor in interface org.opengis.feature.Attribute
Specified by:
getDescriptor in interface org.opengis.feature.Property
Overrides:
getDescriptor in class PropertyImpl

getType

public org.opengis.feature.type.AttributeType getType()
Specified by:
getType in interface org.opengis.feature.Attribute
Specified by:
getType in interface org.opengis.feature.Property
Overrides:
getType in class PropertyImpl

setValue

public void setValue(java.lang.Object newValue)
              throws java.lang.IllegalArgumentException,
                     java.lang.IllegalStateException
Override of setValue to convert the newValue to specified type if need be.

Specified by:
setValue in interface org.opengis.feature.Property
Overrides:
setValue in class PropertyImpl
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalStateException

hashCode

public int hashCode()
Override of hashCode.

Overrides:
hashCode in class PropertyImpl
Returns:
hashCode for this object.

equals

public boolean equals(java.lang.Object obj)
Override of equals.

Overrides:
equals in class PropertyImpl
Parameters:
other - the object to be tested for equality.
Returns:
whether other is equal to this attribute Type.

validate

public void validate()
Specified by:
validate in interface org.opengis.feature.Attribute

toString

public java.lang.String toString()
Overrides:
toString in class PropertyImpl

parse

protected java.lang.Object parse(java.lang.Object value)
                          throws java.lang.IllegalArgumentException
Allows this Attribute to convert an argument to its prefered storage type. If no parsing is possible, returns the original value. If a parse is attempted, yet fails (i.e. a poor decimal format) throw the Exception. This is mostly for use internally in Features, but implementors should simply follow the rules to be safe.

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:
java.lang.IllegalArgumentException - if parsing is attempted and is unsuccessful.


Copyright © 1996-2010 Geotools. All Rights Reserved.