public class Dimension2D extends Object
Constructor and Description |
---|
Dimension2D()
Creates a new instance of Dimension
|
Dimension2D(Dimension2D d)
Creates a new instance of Dimension with a predefine dimension
|
Dimension2D(double width,
double height)
CCreates a new instance of Dimension with width and height
|
Modifier and Type | Method and Description |
---|---|
double |
getHeight()
Return the height of the dimension
|
double |
getWidth()
Returns the width of the dimension
|
void |
setHeight(double height)
Set the height of the dimension
|
void |
setWidth(double width)
Set the width of the dimension
|
String |
toString()
Returns a string representation of the object.
|
public Dimension2D()
public Dimension2D(Dimension2D d)
d
- Dimension to copypublic Dimension2D(double width, double height)
width
- the dimention widthheight
- the dimention heightpublic void setWidth(double width)
width
- the dimention widthpublic void setHeight(double height)
height
- the dimention heightpublic double getWidth()
public double getHeight()
public String toString()