A B C E F G H I L M N P R S T W

A

AbstractGrid<E> - Class in WatorWorld
AbstractGrid contains the methods that are common to grid implementations.
AbstractGrid() - Constructor for class WatorWorld.AbstractGrid
 
act() - Method in class WatorWorld.Actor
Reverses the direction of this actor.
act() - Method in class WatorWorld.Fish
Act to move if possible and then breed if time.
act() - Method in class WatorWorld.Shark
Check if starve then if not, act to move and breed if time.
Actor - Class in WatorWorld
An Actor is an entity with a color and direction that can act.
Actor() - Constructor for class WatorWorld.Actor
Constructs a blue actor that is facing north.
AHEAD - Static variable in class WatorWorld.Location
The turn angle for making no turn.

B

BoundedGrid<E> - Class in WatorWorld
A BoundedGrid is a rectangular grid with a finite number of rows and columns.
BoundedGrid(int, int) - Constructor for class WatorWorld.BoundedGrid
Constructs an empty bounded grid with the given dimensions.

C

compareTo(Location) - Method in class WatorWorld.Location
Compares this location to other for ordering.

E

EAST - Static variable in class WatorWorld.Location
The compass direction for east.
equals(Object) - Method in class WatorWorld.Location
Indicates whether some other Location object is "equal to" this one.

F

Fish - Class in WatorWorld
A class to model a Fish in the Wator simulation.
Fish() - Constructor for class WatorWorld.Fish
Create a new Fish.
FULL_CIRCLE - Static variable in class WatorWorld.Location
The turn angle for turning a full circle.

G

get(Location) - Method in class WatorWorld.BoundedGrid
 
get(Location) - Method in interface WatorWorld.Grid
Returns the object at a given location in this grid.
getAdjacentLocation(int) - Method in class WatorWorld.Location
Gets the adjacent location in any one of the eight compass directions.
getBreedTime() - Static method in class WatorWorld.Fish
 
getBreedTime() - Static method in class WatorWorld.Shark
 
getChar() - Method in class WatorWorld.Actor
Get a simple one char representation of this sea creature.
getChar() - Method in class WatorWorld.Fish
Return the character for Fish.
getChar() - Method in class WatorWorld.Shark
Return the character for Sharks.
getCol() - Method in class WatorWorld.Location
Gets the column coordinate.
getColor() - Method in class WatorWorld.Actor
Gets the color of this actor.
getColor(int, int) - Method in class WatorWorld.WatorWorld
Return the color of the Actor at the specified cell.
getDirection() - Method in class WatorWorld.Actor
Gets the current direction of this actor.
getDirectionToward(Location) - Method in class WatorWorld.Location
Returns the direction from this location toward another location.
getEmptyAdjacentLocations(Location) - Method in class WatorWorld.AbstractGrid
 
getEmptyAdjacentLocations(Location) - Method in interface WatorWorld.Grid
Gets the valid empty locations adjacent to a given location in all eight compass directions (north, northeast, east, southeast, south, southwest, west, and northwest).
getGrid() - Method in class WatorWorld.Actor
Gets the grid in which this actor is located.
getLocation() - Method in class WatorWorld.Actor
Gets the location of this actor.
getNeighbors(Location) - Method in class WatorWorld.AbstractGrid
 
getNeighbors(Location) - Method in interface WatorWorld.Grid
Gets the neighboring occupants in all eight compass directions (north, northeast, east, southeast, south, southwest, west, and northwest).
getNumCols() - Method in class WatorWorld.BoundedGrid
 
getNumCols() - Method in interface WatorWorld.Grid
Returns the number of columns in this grid.
getNumCols() - Method in class WatorWorld.WatorWorld
Get the number of columns in this world.
getNumFish() - Static method in class WatorWorld.Fish
Return the total number of fish that exist.
getNumFish() - Method in class WatorWorld.WatorWorld
Return the number of fish in the simulation.
getNumRows() - Method in class WatorWorld.BoundedGrid
 
getNumRows() - Method in interface WatorWorld.Grid
Returns the number of rows in this grid.
getNumRows() - Method in class WatorWorld.WatorWorld
Get the number of rows in this world.
getNumSharks() - Static method in class WatorWorld.Shark
Returns the current number of sharks.
getNumSharks() - Method in class WatorWorld.WatorWorld
Return the number of sharks in the simulation.
getNumSpots() - Method in class WatorWorld.WatorWorld
Get the total number of cells in this world.
getOccupiedAdjacentLocations(Location) - Method in class WatorWorld.AbstractGrid
 
getOccupiedAdjacentLocations(Location) - Method in interface WatorWorld.Grid
Gets the valid occupied locations adjacent to a given location in all eight compass directions (north, northeast, east, southeast, south, southwest, west, and northwest).
getOccupiedLocations() - Method in class WatorWorld.BoundedGrid
 
getOccupiedLocations() - Method in interface WatorWorld.Grid
Gets the locations in this grid that contain objects.
getOceanColor() - Static method in class WatorWorld.WatorWorld
 
getRow() - Method in class WatorWorld.Location
Gets the row coordinate.
getStandardFishColor() - Static method in class WatorWorld.Fish
Get the standard Fish Color.
getStandardSharkColor() - Static method in class WatorWorld.Shark
 
getStarveTime() - Static method in class WatorWorld.Shark
 
getValidAdjacentLocations(Location) - Method in class WatorWorld.AbstractGrid
 
getValidAdjacentLocations(Location) - Method in interface WatorWorld.Grid
Gets the valid locations adjacent to a given location in all eight compass directions (north, northeast, east, southeast, south, southwest, west, and northwest).
getValidAdjacentLocations(Location) - Method in class WatorWorld.WrappedBoundedGrid
 
Grid<E> - Interface in WatorWorld
Grid provides an interface for a two-dimensional, grid-like environment containing arbitrary objects.

H

HALF_CIRCLE - Static variable in class WatorWorld.Location
The turn angle for turning a half circle.
HALF_LEFT - Static variable in class WatorWorld.Location
The turn angle for turning 45 degrees to the left.
HALF_RIGHT - Static variable in class WatorWorld.Location
The turn angle for turning 45 degrees to the right.
hashCode() - Method in class WatorWorld.Location
Generates a hash code.

I

isEdible() - Method in class WatorWorld.Actor
Check to see if this sea creature can be eaten by other sea creatures
isEdible() - Method in class WatorWorld.Fish
Return if edible, which for fish is true.
isValid(Location) - Method in class WatorWorld.BoundedGrid
 
isValid(Location) - Method in interface WatorWorld.Grid
Checks whether a location is valid in this grid.

L

LEFT - Static variable in class WatorWorld.Location
The turn angle for turning 90 degrees to the left.
Location - Class in WatorWorld
A Location object represents the row and column of a location in a two-dimensional grid.
Location(int, int) - Constructor for class WatorWorld.Location
Constructs a location with given row and column coordinates.

M

moveTo(Location) - Method in class WatorWorld.Actor
Moves this actor to a new location.

N

NORTH - Static variable in class WatorWorld.Location
The compass direction for north.
NORTHEAST - Static variable in class WatorWorld.Location
The compass direction for northeast.
NORTHWEST - Static variable in class WatorWorld.Location
The compass direction for northwest.

P

put(Location, E) - Method in class WatorWorld.BoundedGrid
 
put(Location, E) - Method in interface WatorWorld.Grid
Puts an object at a given location in this grid.
putSelfInGrid(Grid<Actor>, Location) - Method in class WatorWorld.Actor
Puts this actor into a grid.

R

remove(Location) - Method in class WatorWorld.BoundedGrid
 
remove(Location) - Method in interface WatorWorld.Grid
Removes the object at a given location from this grid.
removeSelfFromGrid() - Method in class WatorWorld.Actor
Removes this actor from its grid.
removeSelfFromGrid() - Method in class WatorWorld.Fish
Remove my self from the grid and decrement the total number of fish.
reset(double, double) - Method in class WatorWorld.WatorWorld
Reset the world.
resetNumFish() - Static method in class WatorWorld.Fish
Reset number of fish to zero.
resetNumSharks() - Static method in class WatorWorld.Shark
Reset number of sharks to 0.
RIGHT - Static variable in class WatorWorld.Location
The turn angle for turning 90 degrees to the right.

S

setBreedTime(int) - Static method in class WatorWorld.Fish
Change the number of turns before a fish can breed.
setBreedTime(int) - Static method in class WatorWorld.Shark
Change the base number of turns before sharks can breed
setColor(Color) - Method in class WatorWorld.Actor
Sets the color of this actor.
setDirection(int) - Method in class WatorWorld.Actor
Sets the current direction of this actor.
setStarveTime(int) - Static method in class WatorWorld.Shark
Change the base number of turns a shark must eat within or starve
Shark - Class in WatorWorld
A class to model a Shark in the Wator simulation.
Shark() - Constructor for class WatorWorld.Shark
Create a new shark.
SOUTH - Static variable in class WatorWorld.Location
The compass direction for south.
SOUTHEAST - Static variable in class WatorWorld.Location
The compass direction for southeast.
SOUTHWEST - Static variable in class WatorWorld.Location
The compass direction for southwest.
step() - Method in class WatorWorld.WatorWorld
Perform one step of the simulation.

T

toString() - Method in class WatorWorld.AbstractGrid
Creates a string that describes this grid.
toString() - Method in class WatorWorld.Actor
Creates a string that describes this actor.
toString() - Method in class WatorWorld.Location
Creates a string that describes this location.
toString() - Method in class WatorWorld.WatorWorld
 

W

WatorWorld - package WatorWorld
 
WatorWorld - Class in WatorWorld
Provides a simulation of a Wat-or World as described by A.K.
WatorWorld(int, int, double, double) - Constructor for class WatorWorld.WatorWorld
Create a new Watorworld.
WEST - Static variable in class WatorWorld.Location
The compass direction for west.
WrappedBoundedGrid<E> - Class in WatorWorld
 
WrappedBoundedGrid(int, int) - Constructor for class WatorWorld.WrappedBoundedGrid
 

A B C E F G H I L M N P R S T W