Class TLcdXYFloatPoint

All Implemented Interfaces:
ILcdBounded, ILcdBounds, ILcdPoint, ILcdPointList, ILcdPolypoint, ILcdShape, ILcd2DEditablePoint, ILcd2DEditableShape, ILcdCloneable, Serializable, Cloneable

public class TLcdXYFloatPoint extends ALcd2DEditablePoint implements ILcd2DEditablePoint
This class provides an implementation of ILcd2DEditablePoint in the cartesian space, but internally using floats instead of doubles.

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

See Also:
  • Constructor Details

    • TLcdXYFloatPoint

      public TLcdXYFloatPoint()
      Constructs and initializes a new TLcdXYFloatPoint initialized with (0, 0).
    • TLcdXYFloatPoint

      public TLcdXYFloatPoint(Point aPoint)
      Constructs and initializes a new TLcdXYFloatPoint with the same location as the specified java.awt.Point.
      Parameters:
      aPoint - the AWT point.
    • TLcdXYFloatPoint

      public TLcdXYFloatPoint(ILcdPoint aPoint)
      Constructs and initializes a new TLcdXYFloatPoint with the same location as the specified ILcdPoint.
      Parameters:
      aPoint - the point.
    • TLcdXYFloatPoint

      public TLcdXYFloatPoint(double aX, double aY)
      Constructs and initializes a new TLcdXYFloatPoint with the specified x and y coordinates.
      Parameters:
      aX - the x coordinate.
      aY - the y coordinate.
  • Method Details

    • move2D

      public void move2D(double aX, double aY)
      Changes the point to have the specified location.
      Specified by:
      move2D in interface ILcd2DEditableShape
      Parameters:
      aX - the x coordinate of the new location.
      aY - the y coordinate of the new location.
    • getX

      public final double getX()
      Description copied from interface: ILcdPoint
      Returns the x coordinate of this ILcdPoint.
      Specified by:
      getX in interface ILcdPoint
      Returns:
      the x coordinate of this ILcdPoint.
    • getY

      public final double getY()
      Description copied from interface: ILcdPoint
      Returns the y coordinate of this ILcdPoint.
      Specified by:
      getY in interface ILcdPoint
      Returns:
      the y coordinate of this ILcdPoint.
    • toString

      public String toString()
      Overrides:
      toString in class ALcd2DEditablePoint
    • 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 ALcdShape
      See Also:
    • cloneAs2DEditablePoint

      public ILcd2DEditablePoint cloneAs2DEditablePoint()
      Description copied from interface: ILcdPoint
      Returns a copy of this ILcdPoint that is also an ILcd2DEditablePoint. This makes sure that the first two dimensions of the copy are writable,
      Specified by:
      cloneAs2DEditablePoint in interface ILcdPoint
      Returns:
      a copy of this ILcdPoint that is also an ILcd2DEditablePoint. This makes sure that the first two dimensions of the copy are writable, even if the original ILcdPoint object may be read-only.
      See Also:
    • cloneAs3DEditablePoint

      public ILcd3DEditablePoint cloneAs3DEditablePoint()
      Description copied from interface: ILcdPoint
      Returns a copy of this ILcdPoint that is also an ILcd3DEditablePoint. This makes sure that all three dimensions of the copy are writable,
      Specified by:
      cloneAs3DEditablePoint in interface ILcdPoint
      Returns:
      a copy of this ILcdPoint that is also an ILcd3DEditablePoint. This makes sure that all three dimensions of the copy are writable, even if the original ILcdPoint object may be read-only.
      See Also:
    • cloneAs2DEditableBounds

      public ILcd2DEditableBounds cloneAs2DEditableBounds()
      Description copied from interface: ILcdBounds
      Returns a copy of this ILcdBounds object that is also an ILcd2DEditableBounds. This makes sure that the first two dimensions of the copy are writable, even if the original ILcdBounds object may be read-only.
      Specified by:
      cloneAs2DEditableBounds in interface ILcdBounds
      Returns:
      a copy of this ILcdBounds object that is also an ILcd2DEditableBounds. This makes sure that the first two dimensions of the copy are writable, even if the original ILcdBounds object may be read-only.
      See Also:
    • cloneAs3DEditableBounds

      public ILcd3DEditableBounds cloneAs3DEditableBounds()
      Description copied from interface: ILcdBounds
      Returns a copy of this ILcdBounds object that is also an ILcd3DEditableBounds. This makes sure that all three dimensions of the copy are writable, even if the original ILcdBounds object may be read-only.
      Specified by:
      cloneAs3DEditableBounds in interface ILcdBounds
      Returns:
      a copy of this ILcdBounds object that is also an ILcd3DEditableBounds. This makes sure that all three dimensions of the copy are writable, even if the original ILcdBounds object may be read-only.
      See Also:
    • contains2D

      public boolean contains2D(double aX, double aY)
      Description copied from class: ALcdPoint
      Checks whether this ALcdPoint is equal to the given point in the 2D cartesian plane.
      Specified by:
      contains2D in interface ILcdShape
      Overrides:
      contains2D in class ALcdPoint
      Parameters:
      aX - the x coordinate of the point.
      aY - the y coordinate of the point.
      Returns:
      the boolean result of the equality test.
    • contains2D

      public boolean contains2D(double aX, double aY, double aWidth, double aHeight)
      Description copied from interface: ILcdBounds
      Checks whether this ILcdBounds object contains the given rectangle in the 2D space. Only the first two dimensions of the ILcdBounds object are considered.

      If this bounds is undefined, the result is false.

      Specified by:
      contains2D in interface ILcdBounds
      Overrides:
      contains2D in class ALcdPoint
      Parameters:
      aX - the x coordinate of the rectangle.
      aY - the y coordinate of the rectangle.
      aWidth - the width of the rectangle.
      aHeight - the height of the rectangle.
      Returns:
      the boolean result of the containment test.