org.geotools.feature
Class LenientFeature

Object
  extended by SimpleFeatureImpl
      extended by LenientFeature
All Implemented Interfaces:
Attribute, ComplexAttribute, Feature, Property, SimpleFeature

public class LenientFeature
extends SimpleFeatureImpl

An implementation of SimpleFeature that has a more relaxed attitude about being valid.

Author:
Jesse Eichar

Field Summary
 
Fields inherited from class SimpleFeatureImpl
attributeUserData, featureType, id, index, userData, validating, values
 
Constructor Summary
protected LenientFeature(List<Attribute> attributes, SimpleFeatureType schema, String featureID)
          Creates a new instance of flat feature, which must take a flat feature type schema and all attributes as arguments.
 
Method Summary
 Object clone()
          Creates an exact copy of this feature.
static Object parse(AttributeDescriptor descriptor, Object value)
          Old version of Types.parse that returns null when unhappy.
 void setAttribute(int position, Object val)
          Sets the attribute at position to val.
 void setAttributes(List<Object> attributes)
          Sets all attributes for this feature, passed in as a list.
 
Methods inherited from class SimpleFeatureImpl
equals, getAttribute, getAttribute, getAttribute, getAttributeCount, getAttributes, getBounds, getDefaultGeometry, getDefaultGeometryProperty, getDescriptor, getFeatureType, getID, getIdentifier, getName, getNumberOfAttributes, getProperties, getProperties, getProperties, getProperty, getProperty, getType, getUserData, getValue, hashCode, isNillable, setAttribute, setAttribute, setAttributes, setDefaultGeometry, setDefaultGeometryProperty, setValue, setValue, validate
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LenientFeature

protected LenientFeature(List<Attribute> attributes,
                         SimpleFeatureType schema,
                         String featureID)
                  throws IllegalAttributeException,
                         NullPointerException
Creates a new instance of flat feature, which must take a flat feature type schema and all attributes as arguments.

Parameters:
schema - Feature type schema for this flat feature.
attributes - Initial attributes for this feature.
featureID - The unique ID for this feature.
Throws:
IllegalAttributeException - Attribtues do not conform to feature type schema.
NullPointerException - if schema is null.
Method Detail

setAttribute

public void setAttribute(int position,
                         Object val)
                  throws IllegalAttributeException
Sets the attribute at position to val.

Specified by:
setAttribute in interface SimpleFeature
Overrides:
setAttribute in class SimpleFeatureImpl
Parameters:
position - the index of the attribute to set.
val - the new value to give the attribute at position.
Throws:
IllegalAttributeException - if the passed in val does not validate against the AttributeType at that position.

setAttributes

public void setAttributes(List<Object> attributes)
Sets all attributes for this feature, passed in as a list.

Specified by:
setAttributes in interface SimpleFeature
Overrides:
setAttributes in class SimpleFeatureImpl
Parameters:
attributes - All feature attributes.
Throws:
IllegalAttributeException - Passed attributes do not match feature type.

clone

public Object clone()
Creates an exact copy of this feature.

Overrides:
clone in class Object
Returns:
A default feature.
Throws:
RuntimeException - If some contents are not cloneable.

parse

public static Object parse(AttributeDescriptor descriptor,
                           Object value)
                    throws IllegalArgumentException
Old version of Types.parse that returns null when unhappy.

Throws:
IllegalArgumentException


Copyright © 1996-2009 Geotools. All Rights Reserved.