deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.model.feature
Class AbstractFeature

java.lang.Object
  extended by org.deegree.model.feature.AbstractFeature
All Implemented Interfaces:
Feature
Direct Known Subclasses:
AbstractFeatureCollection, DefaultFeature

abstract class AbstractFeature
extends Object
implements Feature

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $

Field Summary
protected  String description
           
protected  Envelope envelope
           
protected  boolean envelopeCalculated
           
protected  FeatureType featureType
           
protected  FeatureProperty owner
           
 
Constructor Summary
AbstractFeature(String id, FeatureType featureType)
           
AbstractFeature(String id, FeatureType featureType, FeatureProperty owner)
           
 
Method Summary
 Object clone()
           
 String getAttribute(String name)
          Returns the attribute value of the attribute with the specified name.
 Map<String,String> getAttributes()
          Returns all attributes of the feature.
 Envelope getBoundedBy()
          Returns the envelope / boundingbox of the feature.
 String getDescription()
          Returns the description of the feature.
 FeatureType getFeatureType()
          returns the FeatureType of this Feature
 String getId()
          returns the id of the Feature. the id has to be a name space that must be unique for each feature. use the adress of the datasource in addition to a number for example .
 QualifiedName getName()
          Returns the qualified name of the feature.
 FeatureProperty getOwner()
          Returns the owner of the feature.
protected  void resetBounds()
          resets the envelope of the feature so the next call of getBounds() will force a re-calculation
 void setAttribute(String name, String value)
          Sets the value of the attribute with the given name.
 void setEnvelopesUpdated()
          Signals that the envelopes of the geometry properties have been updated.
 void setFeatureType(FeatureType ft)
          Sets the feature type of this feature.
 void setId(String fid)
          Sets the id of the feature.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deegree.model.feature.Feature
addProperty, cloneDeep, getDefaultGeometryPropertyValue, getDefaultProperty, getDefaultProperty, getGeometryPropertyValues, getProperties, getProperties, getProperties, removeProperty, replaceProperty, setProperty
 

Field Detail

featureType

protected FeatureType featureType

envelope

protected Envelope envelope

envelopeCalculated

protected boolean envelopeCalculated

description

protected String description

owner

protected FeatureProperty owner
Constructor Detail

AbstractFeature

AbstractFeature(String id,
                FeatureType featureType)
Parameters:
id -
featureType -

AbstractFeature

AbstractFeature(String id,
                FeatureType featureType,
                FeatureProperty owner)
Parameters:
id -
featureType -
Method Detail

getDescription

public String getDescription()
Description copied from interface: Feature
Returns the description of the feature.

Specified by:
getDescription in interface Feature
Returns:
the description of the feature.

getName

public QualifiedName getName()
Description copied from interface: Feature
Returns the qualified name of the feature.

Specified by:
getName in interface Feature
Returns:
the qualified name of the feature

getBoundedBy

public Envelope getBoundedBy()
                      throws GeometryException
Returns the envelope / boundingbox of the feature. The bounding box will be created in a recursion. That means if a property of the feature (a) contains another feature (b) the bounding box of b will be merged with the bounding box calculated from the geometry properties of a. A feature has no geometry properties and no properties that are features (and having a bounding box theirself) null will be returned.

Specified by:
getBoundedBy in interface Feature
Returns:
the envelope / bounding box of the feature
Throws:
GeometryException

setEnvelopesUpdated

public void setEnvelopesUpdated()
Signals that the envelopes of the geometry properties have been updated.

Specified by:
setEnvelopesUpdated in interface Feature

getOwner

public FeatureProperty getOwner()
Description copied from interface: Feature
Returns the owner of the feature. This is the feature property that has this feature as value or null if this feature is a root feature.

Specified by:
getOwner in interface Feature
Returns:
the owner of the feature, or null if the feature does not belong to a feature property

getId

public String getId()
returns the id of the Feature. the id has to be a name space that must be unique for each feature. use the adress of the datasource in addition to a number for example .

Specified by:
getId in interface Feature
Returns:
the id of the feature

setId

public void setId(String fid)
Description copied from interface: Feature
Sets the id of the feature.

Specified by:
setId in interface Feature
Parameters:
fid - the id of the feature to be set

getFeatureType

public FeatureType getFeatureType()
returns the FeatureType of this Feature

Specified by:
getFeatureType in interface Feature
Returns:
the feature type of this feature

setFeatureType

public void setFeatureType(FeatureType ft)
Sets the feature type of this feature.

Specified by:
setFeatureType in interface Feature
Parameters:
ft - feature type to set

resetBounds

protected void resetBounds()
resets the envelope of the feature so the next call of getBounds() will force a re-calculation


getAttribute

public String getAttribute(String name)
Returns the attribute value of the attribute with the specified name.

Specified by:
getAttribute in interface Feature
Parameters:
name - name of the attribute
Returns:
the attribute value

getAttributes

public Map<String,String> getAttributes()
Returns all attributes of the feature.

Specified by:
getAttributes in interface Feature
Returns:
all attributes, keys are names, values are attribute values

setAttribute

public void setAttribute(String name,
                         String value)
Sets the value of the attribute with the given name.

Specified by:
setAttribute in interface Feature
Parameters:
name - name of the attribute
value - value to set

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in interface Feature
Overrides:
clone in class Object
Returns:
a shallow clone of a feature. Property values will not be cloned except for properties that are features (DefaultFeature) or feature collections (DefaultFeatureCollection)
Throws:
CloneNotSupportedException

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org