|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSimpleFeatureImpl
DefaultFeature
public class DefaultFeature
Provides a more efficient feature representation for the flat and complex features. This implementation actually not only enforces feature type synchronization, it also enforces the use of its accessor methods to change the state of internal object representations. In this case, the implementation is trivial, since all allowed attribute objects (from the feature type) are immutable.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface Feature |
---|
Feature.NULL |
Field Summary |
---|
Fields inherited from class SimpleFeatureImpl |
---|
attributeUserData, featureType, id, index, userData, validating, values |
Constructor Summary | |
---|---|
protected |
DefaultFeature(DefaultFeatureType schema,
Object[] attributes)
Creates a new instance of flat feature, which must take a flat feature type schema and all attributes as arguments. |
protected |
DefaultFeature(DefaultFeatureType schema,
Object[] attributes,
String featureID)
Creates a new instance of flat feature, which must take a flat feature type schema and all attributes as arguments. |
|
DefaultFeature(List attributes,
DefaultFeatureType schema,
String id)
|
Method Summary | |
---|---|
Object |
clone()
Creates an exact copy of this feature. |
boolean |
equals(Object obj)
override of equals. |
Object[] |
getAttributes(Object[] array)
Copy all the attributes of this Feature into the given array. |
ReferencedEnvelope |
getBounds()
Get the total bounds of this feature which is calculated by doing a union of the bounds of each geometry this feature is associated with. |
Geometry |
getDefaultGeometry()
Deprecated. use getDefaultGeometry() . |
FeatureType |
getFeatureType()
Gets a reference to the feature type schema for this feature. |
int |
getNumberOfAttributes()
Get the number of attributes this feature has. |
FeatureCollection<SimpleFeatureType,SimpleFeature> |
getParent()
Gets the feature collection this feature is stored in. |
void |
setAttribute(int position,
Object val)
Sets the attribute at position to val. |
void |
setAttribute(String xPath,
Object attribute)
Sets a single attribute for this feature, passed as a complex object. |
void |
setAttributes(Object[] attributes)
Sets all attributes for this feature, passed as an array. |
void |
setDefaultGeometry(Geometry geometry)
Deprecated. use setDefaultGeometry(Geometry) . |
void |
setParent(FeatureCollection<SimpleFeatureType,SimpleFeature> collection)
Sets the parent collection this feature is stored in, if it is not already set. |
Feature |
toComplex()
|
String |
toString()
Returns a string representation of this feature. |
Methods inherited from class Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface SimpleFeature |
---|
getAttribute, getAttribute |
Methods inherited from interface Feature |
---|
getID |
Methods inherited from interface SimpleFeature |
---|
getAttribute, getAttributeCount, getAttributes, getType, setAttribute, setAttributes, setDefaultGeometry |
Methods inherited from interface Feature |
---|
getDefaultGeometryProperty, getIdentifier, setDefaultGeometryProperty |
Methods inherited from interface ComplexAttribute |
---|
getProperties, getProperties, getProperties, getProperty, getProperty, getValue, setValue, validate |
Methods inherited from interface Attribute |
---|
getDescriptor |
Methods inherited from interface Property |
---|
getName, getUserData, isNillable, setValue |
Constructor Detail |
---|
protected DefaultFeature(DefaultFeatureType schema, Object[] attributes, String featureID) throws IllegalAttributeException, NullPointerException
schema
- Feature type schema for this flat feature.attributes
- Initial attributes for this feature.featureID
- The unique ID for this feature.
IllegalAttributeException
- Attribtues do not conform to feature
type schema.
NullPointerException
- if schema is null.protected DefaultFeature(DefaultFeatureType schema, Object[] attributes) throws IllegalAttributeException
schema
- Feature type schema for this flat feature.attributes
- Initial attributes for this feature.
IllegalAttributeException
- Attribtues do not conform to feature
type schema.public DefaultFeature(List attributes, DefaultFeatureType schema, String id)
Method Detail |
---|
public FeatureType getFeatureType()
getFeatureType
in interface SimpleFeature
getFeatureType
in class SimpleFeatureImpl
public Object[] getAttributes(Object[] array)
array
- The array to copy the attributes into.
public void setAttribute(int position, Object val)
setAttribute
in interface SimpleFeature
setAttribute
in class SimpleFeatureImpl
position
- the index of the attribute to set.val
- the new value to give the attribute at position.
IllegalAttributeException
- if the passed in val does not validate
against the AttributeType at that position.public void setAttributes(Object[] attributes) throws IllegalAttributeException
setAttributes
in interface SimpleFeature
setAttributes
in class SimpleFeatureImpl
attributes
- All feature attributes.
IllegalAttributeException
- Passed attributes do not match feature
type.public void setAttribute(String xPath, Object attribute) throws IllegalAttributeException
setAttribute
in interface SimpleFeature
setAttribute
in class SimpleFeatureImpl
xPath
- XPath representation of attribute location.attribute
- Feature attribute to set.
IllegalAttributeException
- Passed attribute does not match
feature typepublic Geometry getDefaultGeometry()
getDefaultGeometry()
.
getDefaultGeometry
in interface SimpleFeature
getDefaultGeometry
in class SimpleFeatureImpl
public void setDefaultGeometry(Geometry geometry) throws IllegalAttributeException
setDefaultGeometry(Geometry)
.
geometry
- All feature attributes.
IllegalAttributeException
- if the feature does not have a
geometry.public int getNumberOfAttributes()
getNumberOfAttributes
in class SimpleFeatureImpl
public ReferencedEnvelope getBounds()
getBounds
in interface Feature
getBounds
in class SimpleFeatureImpl
public Object clone()
clone
in class Object
RuntimeException
- DOCUMENT ME!public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class SimpleFeatureImpl
obj
- the Object to test for equality.
true
if the object is equal, false
otherwise.public FeatureCollection<SimpleFeatureType,SimpleFeature> getParent()
public void setParent(FeatureCollection<SimpleFeatureType,SimpleFeature> collection)
collection
- the collection to be set as parent.public Feature toComplex()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |