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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidComputes the focus point as the center of the bounding box.voidClears the cache.clone()Creates and returns a copy of this object, by delegating toALcdShape.clone().booleancontains2D(double aX, double aY) Checks whether thisILcdShapecontains the given point in the 2D space.booleancontains3D(double aX, double aY, double aZ) Checks whether thisILcdShapecontains the given point in the 3D space.booleanReturns whether the given object has the same class, the same focus point, and the same shapes (in the same order).Returns theILcdBoundsby which the geometry of thisILcdBoundedobject 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.inthashCode()The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method.voidinsertIntoCache(Object aKey, Object aObject) Inserts a cache Object corresponding to the given key Object.voidNotifies this object that its bounds have changed because one of its shapes has changed.voidInvalidates all cached values of this object.removeCachedObject(Object aKey) Looks up and removes the cached Object corresponding to the given key.voidsetFocusPoint(ILcd3DEditablePoint aFocusPoint) Specifies the focus point value.toString()Methods inherited from class com.luciad.shape.ALcdShape
contains2D, contains3D, fromDomainObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3DMethods 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: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
-
invalidateBounds
public void invalidateBounds()Notifies this object that its bounds have changed because one of its shapes has changed. -
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.
-
getFocusPoint
Returns the focus point of the shape list. This implementation invokescalculateFocusPoint(), if necessary, and then returns the cachedfFocusPoint.- Specified by:
getFocusPointin 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: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.
-
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.
-
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:
clonein interfaceILcdCloneable- Overrides:
clonein 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:ALcdShapeThe 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:ILcdCacheClears the cache.- Specified by:
clearCachein interfaceILcdCache
-
removeCachedObject
Description copied from interface:ILcdCacheLooks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObjectin 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:ILcdCacheLooks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObjectin 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:ILcdCacheInserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCachein 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.
-