Overview
Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
A
B
C
E
F
G
H
I
L
M
N
P
R
S
T
U
W
A
AbstractGrid
<
E
> - Class in
com.collegeboard.gridworld.grid
AbstractGrid()
- Constructor for class com.collegeboard.gridworld.grid.
AbstractGrid
act()
- Method in class com.collegeboard.gridworld.actor.
Actor
Override this method if your actor needs to carry out an action.
act()
- Method in class com.collegeboard.gridworld.actor.
Critter
act()
- Method in class com.collegeboard.gridworld.actor.
Flower
When a flower acts, it "wilts", gradually losing its color.
Actor
- Class in
com.collegeboard.gridworld.actor
Actor()
- Constructor for class com.collegeboard.gridworld.actor.
Actor
Constructs a black actor that is facing north.
ActorWorld
- Class in
com.collegeboard.gridworld.actor
This class manages the world that the actors inhabit, including the display frame and the choices for actors and grids in the frame.
ActorWorld()
- Constructor for class com.collegeboard.gridworld.actor.
ActorWorld
ActorWorld(Grid<Actor>)
- Constructor for class com.collegeboard.gridworld.actor.
ActorWorld
add(Location, Actor)
- Method in class com.collegeboard.gridworld.actor.
ActorWorld
add(T)
- Method in interface com.collegeboard.gridworld.grid.
World
Adds an occupant at a random location
add(Location, T)
- Method in interface com.collegeboard.gridworld.grid.
World
Adds an occupant at a given location
addGridClass(String)
- Method in interface com.collegeboard.gridworld.grid.
World
Adds a class to be shown in the "Set grid" menu.
addOccupantClass(String)
- Method in interface com.collegeboard.gridworld.grid.
World
Adds a class to be shown when clicking on an empty cell
B
BoundedGrid
<
E
> - Class in
com.collegeboard.gridworld.grid
BoundedGrid(int, int)
- Constructor for class com.collegeboard.gridworld.grid.
BoundedGrid
Constructs an empty BoundedGrid object with the given dimensions.
C
canMove()
- Method in class com.collegeboard.gridworld.actor.
Critter
Checks whether this critter can move in the current direction.
col()
- Method in class com.collegeboard.gridworld.grid.
Location
Returns the column coordinate of this location.
com.collegeboard.gridworld.actor
- package com.collegeboard.gridworld.actor
com.collegeboard.gridworld.grid
- package com.collegeboard.gridworld.grid
compareTo(Object)
- Method in class com.collegeboard.gridworld.grid.
Location
Compares this location to
other
for ordering.
Critter
- Class in
com.collegeboard.gridworld.actor
Critter()
- Constructor for class com.collegeboard.gridworld.actor.
Critter
Constructs a green critter that drops flowers as it moves.
Critter(Color)
- Constructor for class com.collegeboard.gridworld.actor.
Critter
Constructs a critter of a given color that drops flowers as it moves.
E
EAST
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
equals(Object)
- Method in class com.collegeboard.gridworld.grid.
Location
Indicates whether some other
Location
object is "equal to" this one.
F
Flower
- Class in
com.collegeboard.gridworld.actor
Some actors drop flowers as they move.
Flower()
- Constructor for class com.collegeboard.gridworld.actor.
Flower
Constructs a pink flower.
Flower(Color)
- Constructor for class com.collegeboard.gridworld.actor.
Flower
Constructs a flower of a given color.
FULL_CIRCLE
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
G
get(Location)
- Method in class com.collegeboard.gridworld.grid.
BoundedGrid
get(Location)
- Method in interface com.collegeboard.gridworld.grid.
Grid
Returns the object at a specific location in this grid (must be valid)
get(Location)
- Method in class com.collegeboard.gridworld.grid.
UnboundedGrid
getAllNeighborLocations(Location)
- Method in class com.collegeboard.gridworld.grid.
AbstractGrid
getAllNeighborLocations(Location)
- Method in interface com.collegeboard.gridworld.grid.
Grid
Gets the valid locations of the neighbors in all directions (north, northeast, east, southeast, south, southwest, west, and northwest)
getColor()
- Method in class com.collegeboard.gridworld.actor.
Actor
Gets the color of this actor.
getDirection()
- Method in class com.collegeboard.gridworld.actor.
Actor
Gets the current direction of this actor.
getGrid()
- Method in class com.collegeboard.gridworld.actor.
Actor
Gets the grid in which this actor is located
getGrid()
- Method in interface com.collegeboard.gridworld.grid.
World
Gets the grid managed by this world.
getGridClasses()
- Method in interface com.collegeboard.gridworld.grid.
World
Gets a set of grid classes that should be used by the world frame for this world.
getLocation()
- Method in class com.collegeboard.gridworld.actor.
Actor
Gets the location of this actor
Precondition: This actor is in a grid
getMainNeighborLocations(Location)
- Method in class com.collegeboard.gridworld.grid.
AbstractGrid
getMainNeighborLocations(Location)
- Method in interface com.collegeboard.gridworld.grid.
Grid
Gets the valid locations of the neighbors in the main directions (north, east, south, and west)
getMessage()
- Method in interface com.collegeboard.gridworld.grid.
World
Gets the message to be displayed in the world frame above the grid.
getNeighborLocation(Location, int)
- Method in class com.collegeboard.gridworld.grid.
AbstractGrid
getNeighborLocation(Location, int)
- Method in interface com.collegeboard.gridworld.grid.
Grid
Gets the location in the given direction, or null if there is no valid location in that direction.
getOccupantClasses()
- Method in interface com.collegeboard.gridworld.grid.
World
Gets a set of occupant classes that should be used by the world frame for this world.
getOccupiedLocations()
- Method in class com.collegeboard.gridworld.grid.
BoundedGrid
getOccupiedLocations()
- Method in interface com.collegeboard.gridworld.grid.
Grid
Gets the locations in this grid that contain objects.
getOccupiedLocations()
- Method in class com.collegeboard.gridworld.grid.
UnboundedGrid
Grid
<
E
> - Interface in
com.collegeboard.gridworld.grid
H
HALF_CIRCLE
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
HALF_LEFT
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
HALF_RIGHT
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
hashCode()
- Method in class com.collegeboard.gridworld.grid.
Location
Generates a hash code for this location (will not be tested on the Advanced Placement exam).
I
isValid(Location)
- Method in class com.collegeboard.gridworld.grid.
AbstractGrid
isValid(Location)
- Method in interface com.collegeboard.gridworld.grid.
Grid
Checks whether a location is valid in this grid.
L
LEFT
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
Location
- Class in
com.collegeboard.gridworld.grid
AP® Computer Science Marine Biology Simulation:
A
Location
object represents the row and column of a location in a two-dimensional grid.
Location(int, int)
- Constructor for class com.collegeboard.gridworld.grid.
Location
Constructs a
Location
object.
locationClicked(Location)
- Method in interface com.collegeboard.gridworld.grid.
World
This method is called when the user clicks on a location in the WorldFrame.
M
move()
- Method in class com.collegeboard.gridworld.actor.
Critter
Moves in the current direction.
moveTo(Location)
- Method in class com.collegeboard.gridworld.actor.
Actor
Moves this actor to a new location.
N
NORTH
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
NORTHEAST
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
NORTHWEST
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
numCols()
- Method in class com.collegeboard.gridworld.grid.
BoundedGrid
numCols()
- Method in interface com.collegeboard.gridworld.grid.
Grid
Returns number of columns in this grid.
numCols()
- Method in class com.collegeboard.gridworld.grid.
UnboundedGrid
numRows()
- Method in class com.collegeboard.gridworld.grid.
BoundedGrid
numRows()
- Method in interface com.collegeboard.gridworld.grid.
Grid
Returns number of rows in this grid.
numRows()
- Method in class com.collegeboard.gridworld.grid.
UnboundedGrid
P
put(Location, E)
- Method in class com.collegeboard.gridworld.grid.
BoundedGrid
put(Location, E)
- Method in interface com.collegeboard.gridworld.grid.
Grid
Adds a new object to this grid.
put(Location, E)
- Method in class com.collegeboard.gridworld.grid.
UnboundedGrid
putInGrid(Grid<Actor>, Location)
- Method in class com.collegeboard.gridworld.actor.
Actor
Puts this actor into a grid.
R
remove(Location)
- Method in class com.collegeboard.gridworld.grid.
BoundedGrid
remove(Location)
- Method in interface com.collegeboard.gridworld.grid.
Grid
Removes an object from this grid.
remove(Location)
- Method in class com.collegeboard.gridworld.grid.
UnboundedGrid
removeFromGrid()
- Method in class com.collegeboard.gridworld.actor.
Actor
Removes an actor from a grid.
RIGHT
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
Rock
- Class in
com.collegeboard.gridworld.actor
A rock is an actor that does nothing.
Rock()
- Constructor for class com.collegeboard.gridworld.actor.
Rock
row()
- Method in class com.collegeboard.gridworld.grid.
Location
Returns the row coordinate of this location.
S
setColor(Color)
- Method in class com.collegeboard.gridworld.actor.
Actor
Sets the color of this actor.
setColor(Color)
- Method in class com.collegeboard.gridworld.actor.
Rock
This method overrides the setColor method in the Actor class to do nothing--rocks are always black.
setGrid(Grid<T>)
- Method in interface com.collegeboard.gridworld.grid.
World
Sets the grid managed by this world.
setMessage(String)
- Method in interface com.collegeboard.gridworld.grid.
World
Sets the message to be displayed in the world frame above the grid.
setTracing(boolean)
- Method in class com.collegeboard.gridworld.actor.
Critter
show()
- Method in interface com.collegeboard.gridworld.grid.
World
Constructs and shows a frame for this world.
SOUTH
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
SOUTHEAST
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
SOUTHWEST
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
step()
- Method in class com.collegeboard.gridworld.actor.
ActorWorld
step()
- Method in interface com.collegeboard.gridworld.grid.
World
This method is called when the user clicks on the step button, or when run mode has been activated by clicking the run button.
T
toString()
- Method in class com.collegeboard.gridworld.actor.
Actor
toString()
- Method in class com.collegeboard.gridworld.grid.
AbstractGrid
Creates a string representing all the objects in this grid (not necessarily in any particular order).
toString()
- Method in class com.collegeboard.gridworld.grid.
Location
Represents this location as a string.
turn(int)
- Method in class com.collegeboard.gridworld.actor.
Actor
Turns the direction of this actor.
turn()
- Method in class com.collegeboard.gridworld.actor.
Critter
Turns 45 degrees to the right.
U
UnboundedGrid
<
E
> - Class in
com.collegeboard.gridworld.grid
UnboundedGrid()
- Constructor for class com.collegeboard.gridworld.grid.
UnboundedGrid
Constructs an empty UnboundedEnv object.
W
WEST
- Static variable in interface com.collegeboard.gridworld.grid.
Grid
World
<
T
> - Interface in
com.collegeboard.gridworld.grid
A world is the mediator between a grid and the GridWorld GUI.
A
B
C
E
F
G
H
I
L
M
N
P
R
S
T
U
W
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes