|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--AquaFish
Aquarium Lab Series: The AquaFish class defines a fish in an aquarium.
Aquarium
Constructor Summary | |
AquaFish(Aquarium aqua)
The AquaFish constructor sets properties of the AquaFish. |
Method Summary | |
boolean |
atBottom()
This function decides whether the fish is at (or below) the bottom. |
boolean |
atLeftWall()
This function decides whether the fish is at (or beyond) the left wall. |
boolean |
atRightWall()
This function decides whether the fish is at (or beyond) the right wall. |
boolean |
atSurface()
This function decides whether the fish is at (or above) the surface. |
boolean |
atWall()
This function decides whether the fish is at (or beyond) a wall. |
void |
changeDir()
This function changes the direction of the fish. |
java.awt.Color |
color()
Get the color of the fish. |
boolean |
facingLeft()
This function decides whether the fish is facing Left. |
boolean |
facingRight()
This function decides whether the fish is facing Right. |
boolean |
facingWall()
This function decides whether a fish is facing a wall. |
int |
fishHeight()
Get the height of the fish. |
int |
fishLength()
Get the length of the fish. |
int |
id()
Get the unique identifier for this fish. |
boolean |
inAquarium()
This function decides whether the fish is in an aquarium. |
void |
move()
This function allows the fish to move horizontally and vertically by random increments. |
java.lang.String |
toString()
This function is provided primarily for debugging purposes. |
void |
undoMove()
This function allows the fish to return to its last position (can only back up once). |
int |
xCoord()
Get the x coordinate of the fish's position in the aquarium. |
int |
yCoord()
Get the y coordinate of the fish's position in the aquarium. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public AquaFish(Aquarium aqua)
aqua
- the Aquarium in which to place the fishMethod Detail |
public int fishLength()
public int fishHeight()
public int id()
public java.awt.Color color()
public boolean inAquarium()
public boolean atWall()
public boolean atLeftWall()
public boolean atRightWall()
public boolean atSurface()
public boolean atBottom()
public boolean facingRight()
public boolean facingLeft()
public boolean facingWall()
public int xCoord()
public int yCoord()
public void move()
public void undoMove()
public void changeDir()
public java.lang.String toString()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |