|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectRectangle
This class represents a Rectangle.
There are two new fields:
private double height
private double width
Field Summary | |
static double |
DEFAULT_HEIGHT
define constant for default height |
static double |
DEFAULT_WIDTH
define constant for default width |
static double |
SHORTEST_HEIGHT
define constant for shortest height |
static double |
SHORTEST_WIDTH
define constant for shortest width |
Constructor Summary | |
Rectangle()
Empty constructor. |
|
Rectangle(double height,
double width)
Complete constructor. |
|
Rectangle(Rectangle rectangle)
Copy constructor. |
Method Summary | |
double |
area()
The area of this object. |
double |
getHeight()
This object height value. |
double |
getWidth()
This object width value. |
double |
perimeter()
The perimeter of this object. |
void |
setHeight(double height)
Set this object height value. |
void |
setRectangle()
Empty set. |
void |
setRectangle(double height,
double width)
Complete set. |
void |
setRectangle(Rectangle rectangle)
Copy set. |
void |
setWidth(double width)
Set this object width value. |
java.lang.String |
toString()
A String representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final double SHORTEST_HEIGHT
public static final double SHORTEST_WIDTH
public static final double DEFAULT_HEIGHT
public static final double DEFAULT_WIDTH
Constructor Detail |
public Rectangle(double height, double width)
height
- the heightwidth
- the widthpublic Rectangle()
height
and width
set to
DEFAULT_HEIGHT
and DEFAULT_WIDTH
respectivly
public Rectangle(Rectangle rectangle)
rectangle
- this object will have height
and
width
set to parameter's valuesMethod Detail |
public double getHeight()
public double getWidth()
public void setHeight(double height)
height
- set this object height value to the parameterpublic void setWidth(double width)
width
- set this object width value to the parameterpublic void setRectangle(double height, double width)
height
- heightwidth
- widthpublic void setRectangle()
height
and width
set to
DEFAULT_HEIGHT
and DEFAULT_WIDTH
respectivly
public void setRectangle(Rectangle rectangle)
rectangle
- this object will have height
and
width
set to parameter's valuespublic double area()
public double perimeter()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |