Class TLcdGML2AbstractFeature

All Implemented Interfaces:
ILcdDataObject, ILcdBounded, ILcdShape, ILcdShapeList, ILcdCloneable, ILcdDeepCloneable, ILcdFeatured, ILcdInvalidateable, ILcdSelfDescribedFeatured, Serializable, Cloneable
Direct Known Subclasses:
TLcdGML2AbstractFeatureCollectionBase

public class TLcdGML2AbstractFeature extends TLcdFeaturedDataObject 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 Link icon

    • FID_PROPERTY Link icon

      public static final TLcdDataProperty FID_PROPERTY
      Data property that maps to the fid attribute. The possible values for this property are instances of String.
    • DESCRIPTION_PROPERTY Link icon

      public static final TLcdDataProperty DESCRIPTION_PROPERTY
      Data property that maps to the description element. The possible values for this property are instances of String.
    • NAME_PROPERTY Link icon

      public static final TLcdDataProperty NAME_PROPERTY
      Data property that maps to the name element. The possible values for this property are instances of String.
    • BOUNDED_BY_PROPERTY Link icon

      public static final TLcdDataProperty BOUNDED_BY_PROPERTY
      Data property that maps to the boundedBy element. The possible values for this property are instances of TLcdGML2BoundingShape.
  • Constructor Details Link icon

    • TLcdGML2AbstractFeature Link icon

      public TLcdGML2AbstractFeature(TLcdDataType aType)
      Creates a new, empty TLcdGML2AbstractFeature. 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 Link icon

    • collectShapes Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      public TLcdGML2AbstractFeature 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 Link icon

      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 Link icon

      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 Link icon

      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
    • getFid Link icon

      public String getFid()
      Returns the value of the property that maps to the fid attribute.
      Returns:
      the value of the FID_PROPERTY property.
    • setFid Link icon

      public void setFid(String aValue)
      Sets the value of the property that maps to the fid attribute.
      Parameters:
      aValue - the value to set for the FID_PROPERTY property.
    • getDescription Link icon

      public String getDescription()
      Returns the value of the property that maps to the description element.
      Returns:
      the value of the DESCRIPTION_PROPERTY property.
    • setDescription Link icon

      public void setDescription(String aValue)
      Sets the value of the property that maps to the description element.
      Parameters:
      aValue - the value to set for the DESCRIPTION_PROPERTY property.
    • getName Link icon

      public String getName()
      Returns the value of the property that maps to the name element.
      Returns:
      the value of the NAME_PROPERTY property.
    • setName Link icon

      public void setName(String aValue)
      Sets the value of the property that maps to the name element.
      Parameters:
      aValue - the value to set for the NAME_PROPERTY property.
    • getBoundedBy Link icon

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

      public void setBoundedBy(TLcdGML2BoundingShape 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.