Package com.luciad.format.gml31.model
Class TLcdGML31AbstractFeature
java.lang.Object
com.luciad.datamodel.TLcdDataObject
com.luciad.datamodel.TLcdFeaturedDataObject
com.luciad.format.gml31.model.TLcdGML31AbstractGML
com.luciad.format.gml31.model.TLcdGML31AbstractFeature
- All Implemented Interfaces:
ILcdDataObject,ILcdBounded,ILcdShape,ILcdShapeList,ILcdCloneable,ILcdDeepCloneable,ILcdFeatured,ILcdInvalidateable,ILcdSelfDescribedFeatured,Serializable,Cloneable
- Direct Known Subclasses:
TLcdGML31AbstractCoverage,TLcdGML31AbstractFeatureCollection,TLcdGML31BoundedFeature,TLcdGML31DynamicFeature,TLcdGML31Model,TLcdGML31Observation
public class TLcdGML31AbstractFeature
extends TLcdGML31AbstractGML
implements ILcdShapeList, ILcdInvalidateable
Default implementation for Java domain model classes modeling XML types extending of
gml:AbstractFeatureType.
gml:AbstractFeatureType is the XML root type for all XML types modeling a real-world
entity, e.g., a city, a building, a road, ... . A GML feature collection is typically mapped on
an ILcdModel in LuciadLightspeed, and the model's elements will be all elements in the GML
feature collection with a type extending of gml:AbstractFeatureType.
The contents of a GML feature can be accessed via two interfaces:
- The
ILcdDataObjectinterface provides access to all properties of this GML feature. -
The
ILcdShapeListinterface provides access to the geometries contained in this feature. The list of shapes will be lazily computed in thecollectShapes()method, the first time it is needed. This method can be overridden in extensions to tweak which geometries are made available via theILcdShapeListinterface of this class.
gml:AbstractFeatureType,
used
by the GML model decoder, will return instances of this class!
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TLcdDataPropertyData property that maps to theboundedByelement.static final TLcdDataPropertyData property that maps to thelocationelement.Fields inherited from class com.luciad.format.gml31.model.TLcdGML31AbstractGML
DESCRIPTION_PROPERTY, ID_PROPERTY, META_DATA_PROPERTY_PROPERTY, NAME_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new, emptyTLcdGML31AbstractFeature. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a deep clone of this object.Returns a deep clone of this object.Override this method to collect all shapes that needs to be included in the ILcdShapeList implementation of this feature.booleancontains2D(double aX, double aY) Checks whether thisILcdShapecontains the given point in the 2D space.booleancontains2D(ILcdPoint aPoint) Checks whether thisILcdShapecontains the givenILcdPointin the 2D space.booleancontains3D(double aX, double aY, double aZ) Checks whether thisILcdShapecontains the given point in the 3D space.booleancontains3D(ILcdPoint aPoint) Checks whether thisILcdShapecontains the givenILcdPointin the 3D space.Returns the value of the property that maps to theboundedByelement.Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.Returns the focus point of thisILcdShape.Returns the value of the property that maps to thelocationelement.getShape(int aIndex) Returns theILcdShapeat the given index.intReturns the number ofILcdShapeobjects in the list.voidInvalidates all cached values of this object.voidsetBoundedBy(TLcdGML31BoundingShape aValue) Sets the value of the property that maps to theboundedByelement.voidsetLocation(Object aValue) Sets the value of the property that maps to thelocationelement.voidNotifies thisILcdShapeListthat some (possibly all) of its shapes have changed.Methods inherited from class com.luciad.format.gml31.model.TLcdGML31AbstractGML
getDescription, getId, getMetaDataProperty, getName, setDescription, setIdMethods inherited from class com.luciad.datamodel.TLcdFeaturedDataObject
canSetFeature, getFeature, getFeature, getFeatureCount, getFeaturedDescriptor, setFeature, setFeatureMethods inherited from class com.luciad.datamodel.TLcdDataObject
getDataType, getValue, getValue, hasValue, hasValue, setValue, setValue, toString
-
Field Details
-
BOUNDED_BY_PROPERTY
Data property that maps to theboundedByelement. The possible values for this property are instances ofTLcdGML31BoundingShape. -
LOCATION_PROPERTY
Data property that maps to thelocationelement. The possible values for this property are instances ofTLcdGML31LocationProperty.
-
-
Constructor Details
-
TLcdGML31AbstractFeature
Creates a new, emptyTLcdGML31AbstractFeature. The specifiedTLcdDataTypeshould be a valid type, that is, it should inherit fromgml:AbstractFeatureType- it may additionally add its own features. See thepackage documentationfor more information on how the XML types are mapped on a data object structure.- Parameters:
aType- theTLcdDataTypedescribing this feature.
-
-
Method Details
-
collectShapes
Override this method to collect all shapes that needs to be included in the ILcdShapeList implementation of this feature. The default implementation recursively searches through all features of thisILcdDataObjectfor all features implementingILcdShape.- Returns:
- the list of shapes contained in this object.
-
shapesChanged
public void shapesChanged()Notifies thisILcdShapeListthat some (possibly all) of its shapes have changed. This method should be called whenever a shape in this GML feature has been changed, or when a shape is inserted in or removed in one the properties of this GML feature. This method is the same asinvalidateObject(). -
getShapeCount
public int getShapeCount()Description copied from interface:ILcdShapeListReturns the number ofILcdShapeobjects in the list.- Specified by:
getShapeCountin interfaceILcdShapeList- Returns:
- the number of
ILcdShapeobjects in the list.
-
getShape
Description copied from interface:ILcdShapeListReturns theILcdShapeat the given index.- Specified by:
getShapein interfaceILcdShapeList- Parameters:
aIndex- a valid index in the list ofILcdShapeobjects.- Returns:
- the
ILcdShapeat the given index. - Throws:
IndexOutOfBoundsException- when the index is not valid.
-
contains2D
Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the givenILcdPointin the 2D space. Only the first two dimensions of theILcdShapeand theILcdPointare considered.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aPoint- theILcdPointto test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the givenILcdPointin the 3D space.- Specified by:
contains3Din interfaceILcdShape- Parameters:
aPoint- theILcdPointto test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
public boolean contains3D(double aX, double aY, double aZ) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 3D space.- Specified by:
contains3Din interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.aZ- the z coordinate of the point.- Returns:
- the boolean result of the containment test.
-
contains2D
public boolean contains2D(double aX, double aY) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 2D space. Only the first two dimensions of theILcdShapeare considered.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
getFocusPoint
Description copied from interface:ILcdShapeReturns the focus point of thisILcdShape.- Specified by:
getFocusPointin interfaceILcdShape- Returns:
- the focus point of this
ILcdShape.
-
clone
Description copied from class:TLcdDataObjectReturns a deep clone of this object. This method delegates toTLcdDataObject.clone(Map).- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classTLcdDataObject- Returns:
- a deep clone of this object
- See Also:
-
clone
Description copied from class:TLcdDataObjectReturns a deep clone of this object. If the clone is not already present in the dictionary, a new instance if created as follows:- First, a new instance is created using Java's clone() mechanism.
- Then, all properties of this object are cloned and set on the newly created
instance. A property is cloned as follows:
- If the property value is an
ILcdDataObject, the value is cloned by first creating a new instance via thevalue.getDataType().newInstance()method, and then cloning its properties one by one. - If the value implements
ILcdDeepCloneableorILcdCloneablethen this interface is used to clone the value. - Otherwise, the property value is copied by reference.
- If the property value is an
- Specified by:
clonein interfaceILcdDeepCloneable- Overrides:
clonein classTLcdDataObject- Parameters:
aObjectDictionary- the Object dictionary that keeps track of the objects for which a clone has already been made, and their corresponding clone Object.- Returns:
- a deep clone of this object
-
getBounds
Description copied from interface:ILcdBoundedReturns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefinedbounds. You can create undefined bounds using the default constructors ofTLcdLonLatBoundsorTLcdXYBounds.- Specified by:
getBoundsin interfaceILcdBounded- Returns:
- the
ILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.
-
invalidateObject
public void invalidateObject()Description copied from interface:ILcdInvalidateableInvalidates all cached values of this object. Call this method whenever one or more of this object's compositing values has been changed, to notify this object it needs to recompute its cached values.- Specified by:
invalidateObjectin interfaceILcdInvalidateable
-
getBoundedBy
Returns the value of the property that maps to theboundedByelement.- Returns:
- the value of the
BOUNDED_BY_PROPERTYproperty.
-
setBoundedBy
Sets the value of the property that maps to theboundedByelement.- Parameters:
aValue- the value to set for theBOUNDED_BY_PROPERTYproperty.
-
getLocation
Returns the value of the property that maps to thelocationelement.Deprecated in GML 3.1.0
- Returns:
- the value of the
LOCATION_PROPERTYproperty. - See Also:
-
setLocation
Sets the value of the property that maps to thelocationelement.Deprecated in GML 3.1.0
- Parameters:
aValue- the value to set for theLOCATION_PROPERTYproperty.
-