Package de.xima.fc.common.geometry
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 typedouble
.- Since:
- 8.4.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Rectangular2DDouble(double width, double height)
Creates a new rectangular shape with the specified width and height.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
dimensions()
The dimension of the rectangle.static Rectangular2DDouble
empty()
Creates an empty rectangular shape with zero width and height.boolean
equals(Object o)
int
hashCode()
Double
height()
Returns the height of the rectangular shape.byte
heightByte()
Returns the height of the rectangular shape as a byte.double
heightDouble()
Returns the height of the rectangular shape as a double.float
heightFloat()
Returns the height of the rectangular shape as a float.int
heightInt()
Returns the height of the rectangular shape as an int.long
heightLong()
Returns the height of the rectangular shape as a long.short
heightShort()
Returns the height of the rectangular shape as a short.Double
length(ECartesianAxis1D axis)
Gets the length of the side along the specified axis.Double
length(ECartesianAxis2D axis)
Gets the length of the side along the specified axis.double
lengthDouble(ECartesianAxis1D axis)
Gets the length of the side along the specified axis, as a double.double
lengthDouble(ECartesianAxis2D axis)
Gets the length of the side along the specified axis as a double.Rectangular2DDouble
plus(byte deltaWidth, byte deltaHeight)
Creates a new rectangular shape with the specified delta width and height added to the current width and height.Rectangular2DDouble
plus(double deltaWidth, double deltaHeight)
Creates a new rectangular shape with the specified delta width and height added to the current width and height.Rectangular2DDouble
plus(float deltaWidth, float deltaHeight)
Creates a new rectangular shape with the specified delta width and height added to the current width and height.Rectangular2DDouble
plus(int deltaWidth, int deltaHeight)
Creates a new rectangular shape with the specified delta width and height added to the current width and height.Rectangular2DDouble
plus(long deltaWidth, long deltaHeight)
Creates a new rectangular shape with the specified delta width and height added to the current width and height.Rectangular2DDouble
plus(short deltaWidth, short deltaHeight)
Creates a new rectangular shape with the specified delta width and height added to the current width and height.Rectangular2DDouble
plus(Double deltaWidth, Double deltaHeight)
Creates a new rectangular shape with the specified delta width and height added to the current width and height.String
toString()
Double
width()
Returns the width of the rectangular shape.double
widthDouble()
Returns the width of the rectangular shape as a double.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.xima.fc.common.geometry.Rectangular1DLike
lengthByte, lengthFloat, lengthInt, lengthLong, lengthShort, widthByte, widthFloat, widthInt, widthLong, widthShort
-
Methods inherited from interface de.xima.fc.common.geometry.Rectangular2D
lengthByte, lengthFloat, lengthInt, lengthLong, lengthShort
-
-
-
-
Method Detail
-
dimensions
public int dimensions()
Description copied from interface:Rectangular
The dimension of the rectangle.- Specified by:
dimensions
in interfaceRectangular
- Specified by:
dimensions
in interfaceRectangular1D<Double>
- Specified by:
dimensions
in interfaceRectangular2D<Double>
- Returns:
- The dimensionality of the rectangle.
-
height
public Double height()
Description copied from interface:Rectangular2D
Returns the height of the rectangular shape.- Specified by:
height
in interfaceRectangular2D<Double>
- Specified by:
height
in interfaceRectangular2DLike<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 interfaceRectangular2D<Double>
- Specified by:
heightByte
in interfaceRectangular2DLike<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 interfaceRectangular2D<Double>
- Specified by:
heightDouble
in interfaceRectangular2DLike<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 interfaceRectangular2D<Double>
- Specified by:
heightFloat
in interfaceRectangular2DLike<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 interfaceRectangular2D<Double>
- Specified by:
heightInt
in interfaceRectangular2DLike<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 interfaceRectangular2D<Double>
- Specified by:
heightLong
in interfaceRectangular2DLike<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 interfaceRectangular2D<Double>
- Specified by:
heightShort
in interfaceRectangular2DLike<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 interfaceRectangular2D<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 interfaceRectangular1DLike<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 interfaceRectangular2D<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 interfaceRectangular1DLike<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 interfaceRectangular2D<Double>
- Parameters:
deltaWidth
- the width to add to the current widthdeltaHeight
- 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 interfaceRectangular2D<Double>
- Parameters:
deltaWidth
- the width to add to the current widthdeltaHeight
- 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 interfaceRectangular2D<Double>
- Parameters:
deltaWidth
- the width to add to the current widthdeltaHeight
- 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 interfaceRectangular2D<Double>
- Parameters:
deltaWidth
- the width to add to the current widthdeltaHeight
- 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 interfaceRectangular2D<Double>
- Parameters:
deltaWidth
- the width to add to the current widthdeltaHeight
- 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 interfaceRectangular2D<Double>
- Parameters:
deltaWidth
- the width to add to the current widthdeltaHeight
- 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 interfaceRectangular2D<Double>
- Parameters:
deltaWidth
- the width to add to the current widthdeltaHeight
- the height to add to the current height- Returns:
- A new rectangular shape with the specified dimensions.
-
width
public Double width()
Description copied from interface:Rectangular1DLike
Returns the width of the rectangular shape.- Specified by:
width
in interfaceRectangular1DLike<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 interfaceRectangular1DLike<Double>
- Returns:
- the width
-
empty
public static Rectangular2DDouble empty()
Creates an empty rectangular shape with zero width and height.- Returns:
- An empty rectangular shape.
-
-