Class ALcdShapeList
- All Implemented Interfaces:
ILcdBounded
,ILcdShape
,ILcdShapeList
,ILcdCache
,ILcdCloneable
,ILcdInvalidateable
,Serializable
,Cloneable
- Direct Known Subclasses:
TLcdAssociationBasedAirspace
,TLcdASTERIXWeatherPicture
,TLcdMinimumSectorAltitude
,TLcdSegmentBasedRoute
,TLcdShapeList
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Computes the focus point as the center of the bounding box.void
Clears the cache.clone()
Creates and returns a copy of this object, by delegating toALcdShape.clone()
.boolean
contains2D
(double aX, double aY) Checks whether thisILcdShape
contains the given point in the 2D space.boolean
contains3D
(double aX, double aY, double aZ) Checks whether thisILcdShape
contains the given point in the 3D space.boolean
Returns whether the given object has the same class, the same focus point, and the same shapes (in the same order).Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.getCachedObject
(Object aKey) Looks up and returns the cached Object corresponding to the given key.Returns the focus point of the shape list.int
hashCode()
The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)
method.void
insertIntoCache
(Object aKey, Object aObject) Inserts a cache Object corresponding to the given key Object.void
Notifies this object that its bounds have changed because one of its shapes has changed.void
Invalidates all cached values of this object.removeCachedObject
(Object aKey) Looks up and removes the cached Object corresponding to the given key.void
setFocusPoint
(ILcd3DEditablePoint aFocusPoint) Specifies the focus point value.toString()
Methods inherited from class com.luciad.shape.ALcdShape
contains2D, contains3D, fromDomainObject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3D
Methods inherited from interface com.luciad.shape.ILcdShapeList
getShape, getShapeCount
-
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 interfaceILcdInvalidateable
-
invalidateBounds
public void invalidateBounds()Notifies this object that its bounds have changed because one of its shapes has changed. -
getBounds
Description copied from interface:ILcdBounded
Returns theILcdBounds
by which the geometry of thisILcdBounded
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 ofTLcdLonLatBounds
orTLcdXYBounds
.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ILcdBounds
by which the geometry of thisILcdBounded
object is bounded.
-
getFocusPoint
Returns the focus point of the shape list. This implementation invokescalculateFocusPoint()
, if necessary, and then returns the cachedfFocusPoint
.- Specified by:
getFocusPoint
in interfaceILcdShape
- 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
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 thisILcdShape
contains the given point in the 2D space. Only the first two dimensions of theILcdShape
are considered.- Specified by:
contains2D
in interfaceILcdShape
- 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 thisILcdShape
contains the given point in the 3D space.- Specified by:
contains3D
in 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.
-
clone
Creates and returns a copy of this object, by delegating toALcdShape.clone()
. Extensions should delegate to this implementation withsuper.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 interfaceILcdCloneable
- Overrides:
clone
in classALcdShape
- See Also:
-
equals
Returns whether the given object has the same class, the same focus point, and the same shapes (in the same order). -
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 theALcdShape.equals(Object)
method. Extensions should refine this implementation, based on their properties. -
toString
-
clearCache
public void clearCache()Description copied from interface:ILcdCache
Clears the cache.- Specified by:
clearCache
in interfaceILcdCache
-
removeCachedObject
Description copied from interface:ILcdCache
Looks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObject
in interfaceILcdCache
- 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
Description copied from interface:ILcdCache
Looks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObject
in interfaceILcdCache
- 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
Description copied from interface:ILcdCache
Inserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCache
in interfaceILcdCache
- 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.
-