Class 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 ILcdDataObject interface provides access to all properties of this GML feature.
  • The ILcdShapeList interface provides access to the geometries contained in this feature. The list of shapes will be lazily computed in the collectShapes() method, the first time it is needed. This method can be overridden in extensions to tweak which geometries are made available via the ILcdShapeList interface of this class.

It is not guaranteed that the default object factory for gml:AbstractFeatureType, used by the GML model decoder, will return instances of this class!

See Also:
  • Field Details

    • BOUNDED_BY_PROPERTY

      public static final TLcdDataProperty BOUNDED_BY_PROPERTY
      Data property that maps to the boundedBy element. The possible values for this property are instances of TLcdGML31BoundingShape.
    • LOCATION_PROPERTY

      public static final TLcdDataProperty LOCATION_PROPERTY
      Data property that maps to the location element. The possible values for this property are instances of TLcdGML31LocationProperty.
  • Constructor Details

    • TLcdGML31AbstractFeature

      public TLcdGML31AbstractFeature(TLcdDataType aType)
      Creates a new, empty TLcdGML31AbstractFeature. The specified TLcdDataType should be a valid type, that is, it should inherit from gml:AbstractFeatureType - it may additionally add its own features.

      See the package documentation for more information on how the XML types are mapped on a data object structure.

      Parameters:
      aType - the TLcdDataType describing this feature.
  • Method Details

    • collectShapes

      protected List<ILcdShape> 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 this ILcdDataObject for all features implementing ILcdShape.
      Returns:
      the list of shapes contained in this object.
    • shapesChanged

      public void shapesChanged()
      Notifies this ILcdShapeList that 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 as invalidateObject().

    • getShapeCount

      public int getShapeCount()
      Description copied from interface: ILcdShapeList
      Returns the number of ILcdShape objects in the list.
      Specified by:
      getShapeCount in interface ILcdShapeList
      Returns:
      the number of ILcdShape objects in the list.
    • getShape

      public ILcdShape getShape(int aIndex) throws IndexOutOfBoundsException
      Description copied from interface: ILcdShapeList
      Returns the ILcdShape at the given index.
      Specified by:
      getShape in interface ILcdShapeList
      Parameters:
      aIndex - a valid index in the list of ILcdShape objects.
      Returns:
      the ILcdShape at the given index.
      Throws:
      IndexOutOfBoundsException - when the index is not valid.
    • contains2D

      public boolean contains2D(ILcdPoint aPoint)
      Description copied from interface: ILcdShape
      Checks whether this ILcdShape contains the given ILcdPoint in the 2D space. Only the first two dimensions of the ILcdShape and the ILcdPoint are considered.
      Specified by:
      contains2D in interface ILcdShape
      Parameters:
      aPoint - the ILcdPoint to test.
      Returns:
      the boolean result of the containment test.
      See Also:
    • contains3D

      public boolean contains3D(ILcdPoint aPoint)
      Description copied from interface: ILcdShape
      Checks whether this ILcdShape contains the given ILcdPoint in the 3D space.
      Specified by:
      contains3D in interface ILcdShape
      Parameters:
      aPoint - the ILcdPoint to 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: ILcdShape
      Checks whether this ILcdShape contains the given point in the 3D space.
      Specified by:
      contains3D in interface ILcdShape
      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: ILcdShape
      Checks whether this ILcdShape contains the given point in the 2D space. Only the first two dimensions of the ILcdShape are considered.
      Specified by:
      contains2D in interface ILcdShape
      Parameters:
      aX - the x coordinate of the point.
      aY - the y coordinate of the point.
      Returns:
      the boolean result of the containment test.
    • getFocusPoint

      public ILcdPoint getFocusPoint()
      Description copied from interface: ILcdShape
      Returns the focus point of this ILcdShape.
      Specified by:
      getFocusPoint in interface ILcdShape
      Returns:
      the focus point of this ILcdShape.
    • clone

      public TLcdGML31AbstractFeature clone()
      Description copied from class: TLcdDataObject
      Returns a deep clone of this object. This method delegates to TLcdDataObject.clone(Map).
      Specified by:
      clone in interface ILcdCloneable
      Overrides:
      clone in class TLcdDataObject
      Returns:
      a deep clone of this object
      See Also:
    • clone

      public TLcdDataObject clone(Map aObjectDictionary)
      Description copied from class: TLcdDataObject
      Returns 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 the value.getDataType().newInstance() method, and then cloning its properties one by one.
        • If the value implements ILcdDeepCloneable or ILcdCloneable then this interface is used to clone the value.
        • Otherwise, the property value is copied by reference.
      Specified by:
      clone in interface ILcdDeepCloneable
      Overrides:
      clone in class TLcdDataObject
      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

      public ILcdBounds getBounds()
      Description copied from interface: ILcdBounded
      Returns the ILcdBounds by which the geometry of this ILcdBounded object 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 undefined bounds. You can create undefined bounds using the default constructors of TLcdLonLatBounds or TLcdXYBounds.

      Specified by:
      getBounds in interface ILcdBounded
      Returns:
      the ILcdBounds by which the geometry of this ILcdBounded object is bounded.
    • invalidateObject

      public void invalidateObject()
      Description copied from interface: ILcdInvalidateable
      Invalidates 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:
      invalidateObject in interface ILcdInvalidateable
    • getBoundedBy

      public TLcdGML31BoundingShape getBoundedBy()
      Returns the value of the property that maps to the boundedBy element.
      Returns:
      the value of the BOUNDED_BY_PROPERTY property.
    • setBoundedBy

      public void setBoundedBy(TLcdGML31BoundingShape aValue)
      Sets the value of the property that maps to the boundedBy element.
      Parameters:
      aValue - the value to set for the BOUNDED_BY_PROPERTY property.
    • getLocation

      public Object getLocation()
      Returns the value of the property that maps to the location element.

      Deprecated in GML 3.1.0

      Returns:
      the value of the LOCATION_PROPERTY property.
      See Also:
    • setLocation

      public void setLocation(Object aValue)
      Sets the value of the property that maps to the location element.

      Deprecated in GML 3.1.0

      Parameters:
      aValue - the value to set for the LOCATION_PROPERTY property.