public class TLcdXYFloatPolypointCache extends TLcdXYFloatPolypoint implements ILcdCache
ILcd2DEditablePolypoint
in
the geodetic space.
Calculations are based on a spherical approximation.
It uses an array of floats instead of a TLcd2DEditablePointList
of ILcd2DEditablePoint
objects. A single array of floats
stores the 2D coordinates. The points are stored as (x,y) pairs.
The boolean indicates whether the last 4 places in the array can be used
to store the bounds of the ILcd2DEditablePolypoint
.
This class is thread-hostile, even for read-only access, since point instances are being reused from an internal pool.
Constructor and Description |
---|
TLcdXYFloatPolypointCache() |
TLcdXYFloatPolypointCache(float[] aPoints,
boolean aHasBounds,
boolean aBoundsInitialized,
boolean aClone) |
TLcdXYFloatPolypointCache(TLcdXYFloatPolypointCache aXYFloatPolypointCache) |
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() . |
Object |
getCachedObject(Object aKey)
Looks up and returns the cached Object corresponding to the given key.
|
void |
insertIntoCache(Object aKey,
Object aObject)
Inserts a cache Object corresponding to the given key Object.
|
protected void |
invalidate() |
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
createBounds, createPoint
calculateBounds, calculateFocusPoint, contains2D, equals, getBounds, getFocusPoint, getPoint, getPointCount, hashCode, insert2DPoint, move2D, move2DPoint, removePointAt, translate2D, translate2DPoint
contains3D, move2D
contains2D, contains3D, fromDomainObject
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
move2D, move2D, translate2D
contains2D, contains2D, contains3D, contains3D, getFocusPoint
getBounds
append2DPoint, insert2DPoint, move2DPoint, removePointAt, translate2D, translate2DPoint
getPoint, getPointCount, getPointSFCT, getX, getY, getZ
public TLcdXYFloatPolypointCache()
public TLcdXYFloatPolypointCache(float[] aPoints, boolean aHasBounds, boolean aBoundsInitialized, boolean aClone)
public TLcdXYFloatPolypointCache(TLcdXYFloatPolypointCache aXYFloatPolypointCache)
protected void invalidate()
invalidate
in class ALcd2DEditableFloatPolypoint
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
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 ALcd2DEditableFloatPolypoint
Object.clone()