Class Rectangular2DDouble

java.lang.Object
de.xima.fc.common.geometry.Rectangular2DDouble
All Implemented Interfaces:
Rectangular, Rectangular1D<Double>, Rectangular1DLike<Double>, Rectangular2D<Double>, Rectangular2DLike<Double>, Serializable

public final class Rectangular2DDouble extends Object implements Rectangular2D<Double>, Rectangular2DLike<Double>
A two-dimensional rectangular shape, with a width and a height, where both dimensions are of type double.
Since:
8.4.0
See Also:
  • Constructor Details

    • Rectangular2DDouble

      public Rectangular2DDouble(double width, double height)
      Creates a new rectangular shape with the specified width and height.
      Parameters:
      width - The width of the rectangle.
      height - The height of the rectangle.
  • Method Details

    • dimensions

      public int dimensions()
      Description copied from interface: Rectangular
      The dimension of the rectangle.
      Specified by:
      dimensions in interface Rectangular
      Specified by:
      dimensions in interface Rectangular1D<Double>
      Specified by:
      dimensions in interface Rectangular2D<Double>
      Returns:
      The dimensionality of the rectangle.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • height

      public Double height()
      Description copied from interface: Rectangular2D
      Returns the height of the rectangular shape.
      Specified by:
      height in interface Rectangular2D<Double>
      Specified by:
      height in interface Rectangular2DLike<Double>
      Returns:
      the height
    • heightByte

      public byte heightByte()
      Description copied from interface: Rectangular2D
      Returns the height of the rectangular shape as a byte.
      Specified by:
      heightByte in interface Rectangular2D<Double>
      Specified by:
      heightByte in interface Rectangular2DLike<Double>
      Returns:
      the height
    • heightDouble

      public double heightDouble()
      Description copied from interface: Rectangular2D
      Returns the height of the rectangular shape as a double.
      Specified by:
      heightDouble in interface Rectangular2D<Double>
      Specified by:
      heightDouble in interface Rectangular2DLike<Double>
      Returns:
      the height
    • heightFloat

      public float heightFloat()
      Description copied from interface: Rectangular2D
      Returns the height of the rectangular shape as a float.
      Specified by:
      heightFloat in interface Rectangular2D<Double>
      Specified by:
      heightFloat in interface Rectangular2DLike<Double>
      Returns:
      the height
    • heightInt

      public int heightInt()
      Description copied from interface: Rectangular2D
      Returns the height of the rectangular shape as an int.
      Specified by:
      heightInt in interface Rectangular2D<Double>
      Specified by:
      heightInt in interface Rectangular2DLike<Double>
      Returns:
      the height
    • heightLong

      public long heightLong()
      Description copied from interface: Rectangular2D
      Returns the height of the rectangular shape as a long.
      Specified by:
      heightLong in interface Rectangular2D<Double>
      Specified by:
      heightLong in interface Rectangular2DLike<Double>
      Returns:
      the height
    • heightShort

      public short heightShort()
      Description copied from interface: Rectangular2D
      Returns the height of the rectangular shape as a short.
      Specified by:
      heightShort in interface Rectangular2D<Double>
      Specified by:
      heightShort in interface Rectangular2DLike<Double>
      Returns:
      the height
    • length

      public Double length(ECartesianAxis2D axis)
      Description copied from interface: Rectangular2D
      Gets the length of the side along the specified axis.
      Specified by:
      length in interface Rectangular2D<Double>
      Parameters:
      axis - the axis to get the length along
      Returns:
      the length along the specified axis
    • length

      public Double length(ECartesianAxis1D axis)
      Description copied from interface: Rectangular1DLike
      Gets the length of the side along the specified axis.
      Specified by:
      length in interface Rectangular1DLike<Double>
      Parameters:
      axis - the axis to get the length along
      Returns:
      The length along the specified axis
    • lengthDouble

      public double lengthDouble(ECartesianAxis2D axis)
      Description copied from interface: Rectangular2D
      Gets the length of the side along the specified axis as a double.
      Specified by:
      lengthDouble in interface Rectangular2D<Double>
      Parameters:
      axis - the axis to get the length along
      Returns:
      the length along the specified axis
    • lengthDouble

      public double lengthDouble(ECartesianAxis1D axis)
      Description copied from interface: Rectangular1DLike
      Gets the length of the side along the specified axis, as a double.
      Specified by:
      lengthDouble in interface Rectangular1DLike<Double>
      Parameters:
      axis - the axis to get the length along
      Returns:
      The length along the specified axis
    • plus

      public Rectangular2DDouble plus(Double deltaWidth, Double deltaHeight)
      Description copied from interface: Rectangular2D
      Creates a new rectangular shape with the specified delta width and height added to the current width and height.
      Specified by:
      plus in interface Rectangular2D<Double>
      Parameters:
      deltaWidth - the width to add to the current width
      deltaHeight - the height to add to the current height
      Returns:
      A new rectangular shape with the specified dimensions.
    • plus

      public Rectangular2DDouble plus(byte deltaWidth, byte deltaHeight)
      Description copied from interface: Rectangular2D
      Creates a new rectangular shape with the specified delta width and height added to the current width and height.
      Specified by:
      plus in interface Rectangular2D<Double>
      Parameters:
      deltaWidth - the width to add to the current width
      deltaHeight - the height to add to the current height
      Returns:
      A new rectangular shape with the specified dimensions.
    • plus

      public Rectangular2DDouble plus(short deltaWidth, short deltaHeight)
      Description copied from interface: Rectangular2D
      Creates a new rectangular shape with the specified delta width and height added to the current width and height.
      Specified by:
      plus in interface Rectangular2D<Double>
      Parameters:
      deltaWidth - the width to add to the current width
      deltaHeight - the height to add to the current height
      Returns:
      A new rectangular shape with the specified dimensions.
    • plus

      public Rectangular2DDouble plus(int deltaWidth, int deltaHeight)
      Description copied from interface: Rectangular2D
      Creates a new rectangular shape with the specified delta width and height added to the current width and height.
      Specified by:
      plus in interface Rectangular2D<Double>
      Parameters:
      deltaWidth - the width to add to the current width
      deltaHeight - the height to add to the current height
      Returns:
      A new rectangular shape with the specified dimensions.
    • plus

      public Rectangular2DDouble plus(long deltaWidth, long deltaHeight)
      Description copied from interface: Rectangular2D
      Creates a new rectangular shape with the specified delta width and height added to the current width and height.
      Specified by:
      plus in interface Rectangular2D<Double>
      Parameters:
      deltaWidth - the width to add to the current width
      deltaHeight - the height to add to the current height
      Returns:
      A new rectangular shape with the specified dimensions.
    • plus

      public Rectangular2DDouble plus(float deltaWidth, float deltaHeight)
      Description copied from interface: Rectangular2D
      Creates a new rectangular shape with the specified delta width and height added to the current width and height.
      Specified by:
      plus in interface Rectangular2D<Double>
      Parameters:
      deltaWidth - the width to add to the current width
      deltaHeight - the height to add to the current height
      Returns:
      A new rectangular shape with the specified dimensions.
    • plus

      public Rectangular2DDouble plus(double deltaWidth, double deltaHeight)
      Description copied from interface: Rectangular2D
      Creates a new rectangular shape with the specified delta width and height added to the current width and height.
      Specified by:
      plus in interface Rectangular2D<Double>
      Parameters:
      deltaWidth - the width to add to the current width
      deltaHeight - the height to add to the current height
      Returns:
      A new rectangular shape with the specified dimensions.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • width

      public Double width()
      Description copied from interface: Rectangular1DLike
      Returns the width of the rectangular shape.
      Specified by:
      width in interface Rectangular1DLike<Double>
      Returns:
      the width
    • widthDouble

      public double widthDouble()
      Description copied from interface: Rectangular1DLike
      Returns the width of the rectangular shape as a double.
      Specified by:
      widthDouble in interface Rectangular1DLike<Double>
      Returns:
      the width
    • empty

      public static Rectangular2DDouble empty()
      Creates an empty rectangular shape with zero width and height.
      Returns:
      An empty rectangular shape.