Class Aquarium
java.lang.Object
|
+--Aquarium
- public class Aquarium
- extends java.lang.Object
Aquarium Lab Series:
The Aquarium class defines an Aquarium and its properties.
- Version:
- 10 July 2002
Constructor Summary |
Aquarium(int width,
int height)
Construct an Aquarium with user-specified size. |
Method Summary |
java.awt.Color |
color()
Determine the color of the aquarium (water color). |
int |
height()
Determine the height of the aquarium. |
boolean |
validLoc(int xCoord,
int yCoord)
This function determines whether the given coordinates specify
a valid location (one that exists within the bounds of the
aquarium). |
int |
width()
Determine the width of the aquarium. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Aquarium
public Aquarium(int width,
int height)
- Construct an Aquarium with user-specified size.
- Parameters:
width
- width of the aquarium when displayed (in pixels)height
- height of the aquarium when displayed (in pixels)
width
public int width()
- Determine the width of the aquarium.
height
public int height()
- Determine the height of the aquarium.
color
public java.awt.Color color()
- Determine the color of the aquarium (water color).
validLoc
public boolean validLoc(int xCoord,
int yCoord)
- This function determines whether the given coordinates specify
a valid location (one that exists within the bounds of the
aquarium).
Copyright© 2002 Alyce Brady