Class ALcdShapeList

java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.ALcdShapeList
All Implemented Interfaces:
ILcdBounded, ILcdShape, ILcdShapeList, ILcdCache, ILcdCloneable, ILcdInvalidateable, Serializable, Cloneable
Direct Known Subclasses:
TLcdAssociationBasedAirspace, TLcdASTERIXWeatherPicture, TLcdMinimumSectorAltitude, TLcdSegmentBasedRoute, TLcdShapeList

public abstract class ALcdShapeList extends ALcdShape implements ILcdShapeList, ILcdInvalidateable, ILcdCache
This abstract class provides a basis for implementing the ILcdShapeList interface.

This class has a bounds cache, which is computed as the union of the bounds of the ILcdShape objects.

This class also has a focus point cache. For for computing the focus point, implementations may override the method calculateFocusPoint(). The default implementation computes the center of the bounding box. The result of calculateFocusPoint() is only used if the focus point has not been set explicitly using setFocusPoint(ILcdPoint).

This class is thread-safe for concurrent read-only access of its contents. For read-write access, external locking must be used. Such locking is typically done at the model level.

See Also:
  • Constructor Details

    • ALcdShapeList

      public ALcdShapeList()
      Constructs a new, empty shape list.
  • Method Details

    • 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
    • invalidateBounds

      public void invalidateBounds()
      Notifies this object that its bounds have changed because one of its shapes has changed.
    • 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.
    • getFocusPoint

      public ILcdPoint getFocusPoint()
      Returns the focus point of the shape list. This implementation invokes calculateFocusPoint(), if necessary, and then returns the cached fFocusPoint.
      Specified by:
      getFocusPoint in interface ILcdShape
      Returns:
      the focus point of this ILcdShape.
    • calculateFocusPoint

      protected void calculateFocusPoint()
      Computes the focus point as the center of the bounding box. The resulting point is stored in the focus point cache.
    • setFocusPoint

      public void setFocusPoint(ILcd3DEditablePoint aFocusPoint)
      Specifies the focus point value.
      Parameters:
      aFocusPoint - the new focus point value.
      See Also:
    • 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.
    • 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.
    • clone

      public Object clone()
      Creates and returns a copy of this object, by delegating to ALcdShape.clone(). Extensions should delegate to this implementation with super.clone(), in order to create an object instance of the right type, with all fields copied. They then should explicitly clone any non-primitive fields for which a deeper clone is required.
      Specified by:
      clone in interface ILcdCloneable
      Overrides:
      clone in class ALcdShape
      See Also:
    • equals

      public boolean equals(Object aObject)
      Returns whether the given object has the same class, the same focus point, and the same shapes (in the same order).
      Overrides:
      equals in class ALcdShape
    • hashCode

      public int hashCode()
      Description copied from class: ALcdShape
      The hash code of this shape is the hash code of its class, in order to be consistent with the ALcdShape.equals(Object) method. Extensions should refine this implementation, based on their properties.
      Overrides:
      hashCode in class ALcdShape
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clearCache

      public void clearCache()
      Description copied from interface: ILcdCache
      Clears the cache.
      Specified by:
      clearCache in interface ILcdCache
    • removeCachedObject

      public Object removeCachedObject(Object aKey)
      Description copied from interface: ILcdCache
      Looks up and removes the cached Object corresponding to the given key.
      Specified by:
      removeCachedObject in interface ILcdCache
      Parameters:
      aKey - the key Object that was used for storing the cache Object.
      Returns:
      the cached Object, or null if there was no Object corresponding to the given key.
    • getCachedObject

      public Object getCachedObject(Object aKey)
      Description copied from interface: ILcdCache
      Looks up and returns the cached Object corresponding to the given key.
      Specified by:
      getCachedObject in interface ILcdCache
      Parameters:
      aKey - the key Object that was used for storing the cache Object.
      Returns:
      the cached Object, or null if there is no Object corresponding to the given key.
    • insertIntoCache

      public void insertIntoCache(Object aKey, Object aObject)
      Description copied from interface: ILcdCache
      Inserts a cache Object corresponding to the given key Object.
      Specified by:
      insertIntoCache in interface ILcdCache
      Parameters:
      aKey - the key Object that will be used to identify the Object. The key must therefore be a unique identifier, typically the caller itself: insertIntoCache(this, ...).
      aObject - the Object to be cached.