public class TLcdSurface extends ALcdShape implements ILcdEditableSurface, ILcdCache
ILcdEditableSurface
.
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.
Constructor and Description |
---|
TLcdSurface() |
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache.
|
Object |
clone()
Creates and returns a copy of this object, by delegating to
Object.clone() . |
boolean |
contains2D(double aX,
double aY)
Checks whether this
ILcdShape contains the given point in
the 2D space. |
boolean |
contains3D(double aX,
double aY,
double aZ)
Checks whether this
ILcdShape contains the given point in
the 3D space. |
boolean |
equals(Object aObject)
An object is considered equal to this shape if it has the same class.
|
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
Object |
getCachedObject(Object aKey)
Looks up and returns the cached Object corresponding to the given key.
|
ILcdRing |
getExteriorRing()
Returns the exterior boundary of this surface.
|
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
List<ILcdRing> |
getInteriorRings()
Returns the holes in this surface, as a list of
ILcdRing instances. |
int |
hashCode()
The hash code of this shape is the hash code of its class, in order to
be consistent with the
ALcdShape.equals(Object) method. |
void |
insertIntoCache(Object aKey,
Object aObject)
Inserts a cache Object corresponding to the given key Object.
|
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
void |
setExteriorRing(ILcdRing aRing)
Sets the exterior boundary of this surface.
|
contains2D, contains3D, fromDomainObject
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
contains2D, contains3D
public ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
ILcdShape
.public boolean contains2D(double aX, double aY)
ILcdShape
ILcdShape
contains the given point in
the 2D space. Only the first two dimensions of the ILcdShape
are considered.contains2D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public boolean contains3D(double aX, double aY, double aZ)
ILcdShape
ILcdShape
contains the given point in
the 3D space.contains3D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.public ILcdBounds getBounds()
ILcdBounded
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
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public void setExteriorRing(ILcdRing aRing)
ILcdEditableSurface
Note that this implementations may throw a
ClassCastException
or IllegalArgumentException
in case the class of the ring is not
compatible with the implementation of the surface. Implementations should
specify in their documentation all restrictions that apply in this context.
setExteriorRing
in interface ILcdEditableSurface
aRing
- the exterior boundary of this surface.public ILcdRing getExteriorRing()
ILcdSurface
getExteriorRing
in interface ILcdSurface
public List<ILcdRing> getInteriorRings()
ILcdEditableSurface
ILcdRing
instances.
If there are no holes, an empty list is returned.
The returned list is editable and can be used to add, remove or replace interior rings.
getInteriorRings
in interface ILcdEditableSurface
getInteriorRings
in interface ILcdSurface
public Object clone()
ALcdShape
Object.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.clone
in interface ILcdCloneable
clone
in class ALcdShape
Object.clone()
public boolean equals(Object aObject)
ALcdShape
public int hashCode()
ALcdShape
ALcdShape.equals(Object)
method.
Extensions should refine this implementation, based on their properties.public void insertIntoCache(Object aKey, Object aObject)
ILcdCache
insertIntoCache
in interface ILcdCache
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.public Object getCachedObject(Object aKey)
ILcdCache
getCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public Object removeCachedObject(Object aKey)
ILcdCache
removeCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public void clearCache()
ILcdCache
clearCache
in interface ILcdCache