A C D E F G H I L M N O R S T W
A
- act() -
Method in class Minnow
- Acts for one step in the simulation.
- add(Locatable) -
Method in interface Environment
- Adds a new object to this environment at the location it specifies.
- allObjects() -
Method in interface Environment
- Returns all the objects in this environment.
C
- col() -
Method in class Location
- Returns the column coordinate of this location.
- color() -
Method in class Minnow
- Returns this minnow's color.
- compareTo(Object) -
Method in class Location
- Compares this location to
other
for ordering.
D
- Direction - class Direction.
- AP® Computer Science Marine Biology Simulation:
The Direction
class encapsulates the notion of a compass
direction such as North, East, South, West. - direction() -
Method in class Minnow
- Returns this minnow's direction.
- Direction() -
Constructor for class Direction
- Constructs a default
Direction
object facing North.
- Direction(int) -
Constructor for class Direction
- Constructs a
Direction
object.
- Direction(String) -
Constructor for class Direction
- Constructs a
Direction
object.
- draw(Locatable, Component, Graphics2D, Rectangle) -
Method in class MinnowDisplay
- Draw the given object.
- draw(Minnow, Component, Graphics2D) -
Method in class MinnowDisplay
- Draws the given Minnow.
E
- EAST -
Static variable in class Direction
-
- Environment - interface Environment.
- AP® Computer Science Marine Biology Simulation:
Environment
provides an interface for a two-dimensional,
grid-like environment containing locatable objects. - environment() -
Method in class Minnow
- Returns this minnow's environment.
- equals(Object) -
Method in class Direction
- Indicates whether some other
Direction
object
is "equal to" this one.
- equals(Object) -
Method in class Location
- Indicates whether some other
Location
object is
"equal to" this one.
F
- FULL_CIRCLE -
Static variable in class Direction
- Number of degrees in compass
(will not be tested on the Advanced Placement exam).
G
- getDirection(Location, Location) -
Method in interface Environment
- Returns the direction from one location to another.
- getInstance() -
Static method in class RandNumGenerator
- Returns a random number generator.
- getNeighbor(Location, Direction) -
Method in interface Environment
- Returns the adjacent neighbor (whether valid or invalid) of a location
in the specified direction.
H
- hashCode() -
Method in class Direction
- Generates a hash code for this direction
(will not be tested on the Advanced Placement exam).
- hashCode() -
Method in class Location
- Generates a hash code for this location
(will not be tested on the Advanced Placement exam).
I
- inDegrees() -
Method in class Direction
- Returns this direction value in degrees.
- isEmpty(Location) -
Method in interface Environment
- Determines whether a specific location in this environment is
empty.
- isValid(Location) -
Method in interface Environment
- Verifies whether a location is valid in this environment.
L
- Locatable - interface Locatable.
- AP® Computer Science Marine Biology Simulation:
Locatable
is an interface that guarantees that an object
knows its location and returns it when the location
method is called. - Location - class Location.
- AP® Computer Science Marine Biology Simulation:
A Location
object represents the row and column of a
location in a two-dimensional grid. - location() -
Method in interface Locatable
- Returns the location of this object.
- location() -
Method in class Minnow
- Returns this minnow's location.
- Location(int, int) -
Constructor for class Location
- Constructs a
Location
object.
M
- main(String[]) -
Static method in class MinnowApp
- Starts the Minnow program.
- Minnow - class Minnow.
- Minnow Program:
The Minnow class represents a simple fish in an environment. - Minnow(Environment, Location) -
Constructor for class Minnow
- Constructs a minnow at the specified location in a given environment.
- MinnowApp - class MinnowApp.
- Minnow Program:
The MinnowApp
class provides a main method that creates
a simulation of three minnows swimming in a small bounded environment. - MinnowApp() -
Constructor for class MinnowApp
-
- MinnowDisplay - class MinnowDisplay.
- Minnow Program:
A MinnowDisplay
draws a minnow. - MinnowDisplay() -
Constructor for class MinnowDisplay
- Constructs an object that knows how to draw minnows.
- MinnowGUI - class MinnowGUI.
- Minnow Program:
The MinnowGUI
class provides a window in which
to run and display the environment in the Minnow program. - MinnowGUI(String, Color, int, int, int) -
Constructor for class MinnowGUI
- Creates a new MinnowGUI with no menu bar.
N
- neighborsOf(Location) -
Method in interface Environment
- Returns the adjacent neighbors of a specified location.
- NORTH -
Static variable in class Direction
-
- NORTHEAST -
Static variable in class Direction
-
- NORTHWEST -
Static variable in class Direction
-
- numAdjacentNeighbors() -
Method in interface Environment
- Returns the number of adjacent neighbors around each cell.
- numCellSides() -
Method in interface Environment
- Returns the number of sides around each cell.
- numCols() -
Method in interface Environment
- Returns number of columns in this environment.
- numObjects() -
Method in interface Environment
- Returns the number of objects in this environment.
- numRows() -
Method in interface Environment
- Returns number of rows in this environment.
O
- objectAt(Location) -
Method in interface Environment
- Returns the object at a specific location in this environment.
R
- RandNumGenerator - class RandNumGenerator.
- AP® Computer Science Marine Biology Simulation:
The RandNumGenerator
class provides a singleton
java.util.Random
object for random number generation. - RandNumGenerator() -
Constructor for class RandNumGenerator
-
- randomDirection() -
Static method in class Direction
- Returns a random direction.
- randomDirection() -
Method in interface Environment
- Generates a random direction.
- recordMove(Locatable, Location) -
Method in interface Environment
- Updates this environment to reflect the fact that an object moved.
- remove(Locatable) -
Method in interface Environment
- Removes the object from this environment.
- reverse() -
Method in class Direction
- Returns the direction that is the reverse of this
Direction
object.
- roundedDir(int, Direction) -
Method in class Direction
- Rounds this direction to the nearest "cardinal" direction
(will not be tested on the Advanced Placement exam).
The choice of possible cardinal directions depends on the number
of cardinal directions and the starting direction.
- row() -
Method in class Location
- Returns the row coordinate of this location.
S
- setEnv(Environment) -
Method in class MinnowGUI
- Sets the Environment being displayed.
- Simulation - class Simulation.
- AP® Computer Science Marine Biology Simulation:
A Simulation
object controls a simulation of fish
movement in an Environment
. - Simulation(Environment, EnvDisplay) -
Constructor for class Simulation
- Constructs a
Simulation
object for a particular
environment.
- SOUTH -
Static variable in class Direction
-
- SOUTHEAST -
Static variable in class Direction
-
- SOUTHWEST -
Static variable in class Direction
-
- step() -
Method in class Simulation
- Runs through a single step of this simulation.
T
- toLeft() -
Method in class Direction
- Returns the direction that is a quarter turn
to the left of this
Direction
object.
- toLeft(int) -
Method in class Direction
- Returns the direction that is
deg
degrees
to the left of this Direction
object.
- toRight() -
Method in class Direction
- Returns the direction that is a quarter turn
to the right of this
Direction
object.
- toRight(int) -
Method in class Direction
- Returns the direction that is
deg
degrees
to the right of this Direction
object.
- toString() -
Method in class Direction
- Represents this direction as a string.
- toString() -
Method in class Location
- Represents this location as a string.
- toString() -
Method in class Minnow
- Returns a string representing key information about this minnow.
W
- WEST -
Static variable in class Direction
-
A C D E F G H I L M N O R S T W
Copyright© 2002-2003 Alyce Brady