|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--blue.shapes.Rectangle
A 'rectangle' is modeled in terms its height and its width, both real numbers.
Constructor Summary | |
Rectangle(double h,
double w)
Create a circle. |
Method Summary | |
double |
area()
Returns the area of the rectangle. |
void |
describe()
Write a description of this rectangle to the standard output file. |
void |
describe(OutStream os)
Write a description of this rectangle to the given OutStream. |
void |
describe(java.io.PrintStream pss)
Write a description of this rectangle to the given PrintStream. |
double |
diagonal()
Returns the diagonal of the rectangle. |
void |
expandHeight(double f)
Expand the height of the given rectangle. |
void |
expandWidth(double f)
Expand the width of the given rectangle. |
double |
height()
Returns the height of the rectangle. |
double |
perimeter()
Returns the perimeter of the rectangle. |
void |
shrinkHeight(double f)
Shrink the height of the given rectangle. |
void |
shrinkWidth(double f)
Shrink the width of the given rectangle. |
double |
width()
Returns the width of the rectangle. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Rectangle(double h, double w)
h
- the height of the rectangle.w
- the width of the rectangle.Method Detail |
public double height()
public double width()
public double diagonal()
public double area()
public double perimeter()
public void describe()
public void describe(java.io.PrintStream pss)
ps
- the PrintStream to which the description is written.public void describe(OutStream os)
os
- the OutStream to which the description is written.public void shrinkWidth(double f)
d
- the amount by which to shrink the width.public void expandWidth(double f)
d
- the amount by which to expand the width.public void shrinkHeight(double f)
d
- the amount by which to shrink the height.public void expandHeight(double f)
d
- the amount by which to expand the height.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |