Class TLcd2DEditablePointListLonLatFloatArray

java.lang.Object
com.luciad.shape.shape2D.TLcd2DEditablePointListLonLatFloatArray
All Implemented Interfaces:
ILcdPointList, ILcd2DEditablePointList, ILcdCloneable, Serializable, Cloneable

public class TLcd2DEditablePointListLonLatFloatArray extends Object implements ILcd2DEditablePointList, ILcdCloneable
This class provides an implementation of ILcd2DEditablePointList. This implementation uses an array of the right size to store the coordinates of the points, which is memory efficient, but inefficient for adding and removing points.

This class is thread-safe for read-only access.

See Also:
  • Constructor Details

    • TLcd2DEditablePointListLonLatFloatArray

      public TLcd2DEditablePointListLonLatFloatArray()
      Constructs a new empty TLcd2DEditablePointList.
    • TLcd2DEditablePointListLonLatFloatArray

      public TLcd2DEditablePointListLonLatFloatArray(float[] aPoints, boolean aDeepCopy)
      Constructs a new TLcd2DEditablePointList that is a copy of the given ILcd2DEditablePointList.
      Parameters:
      aPoints - an array of lon/lat coordinates. The n'th point is specified by the values aPoints[2n] (longitude) and aPoints[2n+1] (latitude).
      aDeepCopy - a boolean indicating whether the individual points in the list should be cloned or just referenced.
    • TLcd2DEditablePointListLonLatFloatArray

      public TLcd2DEditablePointListLonLatFloatArray(TLcd2DEditablePointListLonLatFloatArray a2DEditablePointListLonLatFloatArray, boolean aDeepCopy)
  • Method Details

    • getPointCount

      public final int getPointCount()
      Description copied from interface: ILcdPointList
      Returns the number of ILcdPoint objects in the list.
      Specified by:
      getPointCount in interface ILcdPointList
      Returns:
      the number of ILcdPoint objects in the list.
    • getPoint

      public final ILcdPoint getPoint(int aIndex)
      Description copied from interface: ILcdPointList
      Returns the ILcdPoint at a given index.
      Specified by:
      getPoint in interface ILcdPointList
      Parameters:
      aIndex - a valid index in the list of ILcdPoint objects.
      Returns:
      the ILcdPoint at the given index.
    • translate2D

      public void translate2D(double aDeltaX, double aDeltaY)
      Description copied from interface: ILcd2DEditablePointList
      Translates all the points of this ILcd2DEditablePointList from their current positions over the given translation vector in the 2D space. Only the first two dimensions of the points are considered. The third dimension is left unchanged.
      Specified by:
      translate2D in interface ILcd2DEditablePointList
      Parameters:
      aDeltaX - the x coordinate of the translation vector.
      aDeltaY - the y coordinate of the translation vector.
    • move2DPoint

      public void move2DPoint(int aIndex, double aX, double aY)
      Description copied from interface: ILcd2DEditablePointList
      Moves the specified point of this ILcd2DEditablePointList to the given point in the 2D space. Only the first two dimensions of the ILcdShape are considered. The third dimension is left unchanged.
      Specified by:
      move2DPoint in interface ILcd2DEditablePointList
      Parameters:
      aIndex - a valid index in the list of points.
      aX - the x coordinate of the point.
      aY - the y coordinate of the point.
    • translate2DPoint

      public void translate2DPoint(int aIndex, double aDeltaX, double aDeltaY)
      Description copied from interface: ILcd2DEditablePointList
      Translates the specified point of this ILcd2DEditablePointList from its current position over the given translation vector in the 2D space. Only the first two dimensions of the points are considered. The third dimension is left unchanged.
      Specified by:
      translate2DPoint in interface ILcd2DEditablePointList
      Parameters:
      aDeltaX - the x coordinate of the translation vector.
      aDeltaY - the y coordinate of the translation vector.
    • insert2DPoint

      public void insert2DPoint(int aIndex, ILcd2DEditablePoint a2DEditablePoint)
    • insert2DPoint

      public void insert2DPoint(int aIndex, double aX, double aY)
      Description copied from interface: ILcd2DEditablePointList
      Inserts a point at the given index into this ILcd2DEditablePointList.
      Specified by:
      insert2DPoint in interface ILcd2DEditablePointList
      Parameters:
      aIndex - a valid new index in the list of points.
      aX - the x coordinate of the new point.
      aY - the y coordinate of the new point.
    • removePointAt

      public void removePointAt(int aIndex)
      Description copied from interface: ILcd2DEditablePointList
      Removes the point at the given index from this ILcd2DEditablePointList.
      Specified by:
      removePointAt in interface ILcd2DEditablePointList
      Parameters:
      aIndex - a valid index in the list of ILcdPoint objects.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • clone

      public Object clone()
      Description copied from interface: ILcdCloneable

      Makes Object.clone() public.

      When for example extending from java.lang.Object, it can be implemented like this:
      
       public Object clone() {
         try {
           return super.clone();
         } catch ( CloneNotSupportedException e ) {
           // Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
           throw new RuntimeException( e );
         }
       }
       
      Specified by:
      clone in interface ILcdCloneable
      Overrides:
      clone in class Object
      See Also: