|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--blue.shapes.Square
A 'square' is modeled in terms of its side length, a real number.
Constructor Summary | |
Square(double s)
Create a square. |
Method Summary | |
double |
area()
Returns the area of this square. |
Circle |
circumscribingCircle()
Return the smallest circle which bounds this square. |
void |
describe()
Write a description of this square to the standard output file. |
void |
describe(OutStream os)
Write a description of this square to the given OutStream. |
void |
describe(java.io.PrintStream ps)
Write a description of this square to the given PrintStream. |
double |
diagonal()
Returns the diagonal of this square. |
void |
expand(double d)
Expand this square by augmenting its side by the given number. |
Circle |
inscribingCircle()
Return the largest circle which is bounded by this square. |
double |
perimeter()
Returns the perimeter of this square. |
void |
shrink(double d)
Shrink this square by diminishing its side by the given number. |
double |
side()
Returns the side length of this square. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Square(double s)
s
- the side length of the squareMethod Detail |
public double side()
public double diagonal()
public double area()
public void describe()
public void describe(java.io.PrintStream ps)
ps
- the stream to which the description is writtenpublic void describe(OutStream os)
os
- the stream to which the description is writtenpublic double perimeter()
public void expand(double d)
a
- amount by which the square is expandedpublic void shrink(double d)
a
- amount by which the square is contractedpublic Circle inscribingCircle()
public Circle circumscribingCircle()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |