Class TLcdXYFloatPolypointCache

All Implemented Interfaces:
ILcdBounded, ILcdPointList, ILcdPolypoint, ILcdShape, ILcd2DEditablePointList, ILcd2DEditablePolypoint, ILcd2DEditableShape, ILcdCache, ILcdCloneable, Serializable, Cloneable

public class TLcdXYFloatPolypointCache extends TLcdXYFloatPolypoint implements ILcdCache
This class provides an implementation of 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.

See Also:
  • Constructor Details

    • TLcdXYFloatPolypointCache

      public TLcdXYFloatPolypointCache()
    • TLcdXYFloatPolypointCache

      public TLcdXYFloatPolypointCache(float[] aPoints, boolean aHasBounds, boolean aBoundsInitialized, boolean aClone)
    • TLcdXYFloatPolypointCache

      public TLcdXYFloatPolypointCache(TLcdXYFloatPolypointCache aXYFloatPolypointCache)
  • Method Details

    • invalidate

      protected void invalidate()
      Overrides:
      invalidate in class ALcd2DEditableFloatPolypoint
    • 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.
    • 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.
    • 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.
    • clearCache

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

      public Object clone()
      Description copied from class: ALcdShape
      Creates and returns a copy of this object, by delegating to 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.
      Specified by:
      clone in interface ILcdCloneable
      Overrides:
      clone in class ALcd2DEditableFloatPolypoint
      See Also: