Overview
Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
A
B
C
D
E
F
G
H
I
L
M
N
P
R
S
T
U
W
A
act()
- Method in class com.collegeboard.gridworld.actor.
Actor
Override this method with the action that your actor carries out.actor needs to
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.
act()
- Method in class com.collegeboard.gridworld.actor.
Rock
This method defines the abstract method of the Actor class to do nothing.
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
A world that is occupied by actors.
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 class com.collegeboard.gridworld.world.
World
Adds an occupant at a random location
add(Location, T)
- Method in class com.collegeboard.gridworld.world.
World
Adds an occupant at a given location.
addGridClass(String)
- Method in class com.collegeboard.gridworld.world.
World
Adds a class to be shown in the "Set grid" menu.
addOccupantClass(String)
- Method in class com.collegeboard.gridworld.world.
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
com.collegeboard.gridworld.world
- package com.collegeboard.gridworld.world
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.
D
directionToward(Location)
- Method in class com.collegeboard.gridworld.grid.
Location
Returns the direction from this location toward another location
E
EAST
- Static variable in class com.collegeboard.gridworld.grid.
Location
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 class com.collegeboard.gridworld.grid.
Location
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
get(Location)
- Method in class com.collegeboard.gridworld.grid.
UnboundedGrid
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 class com.collegeboard.gridworld.world.
World
Gets the grid managed by this world.
getGridClasses()
- Method in class com.collegeboard.gridworld.world.
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
getMessage()
- Method in class com.collegeboard.gridworld.world.
World
Gets the message to be displayed in the world frame above the grid.
getNeighborLocation(int)
- Method in class com.collegeboard.gridworld.grid.
Location
Gets the neighbor location in the given direction
getOccupantClasses()
- Method in class com.collegeboard.gridworld.world.
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
getValidNeighborLocations()
- Method in class com.collegeboard.gridworld.actor.
Actor
Gets the valid locations of the neighbors in all directions (north, northeast, east, southeast, south, southwest, west, and northwest)
Precondition: This actor is in a grid
Grid
<
E
> - Interface in
com.collegeboard.gridworld.grid
H
HALF_CIRCLE
- Static variable in class com.collegeboard.gridworld.grid.
Location
HALF_LEFT
- Static variable in class com.collegeboard.gridworld.grid.
Location
HALF_RIGHT
- Static variable in class com.collegeboard.gridworld.grid.
Location
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.
BoundedGrid
isValid(Location)
- Method in interface com.collegeboard.gridworld.grid.
Grid
Checks whether a location is valid in this grid.
isValid(Location)
- Method in class com.collegeboard.gridworld.grid.
UnboundedGrid
L
LEFT
- Static variable in class com.collegeboard.gridworld.grid.
Location
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 class com.collegeboard.gridworld.world.
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 class com.collegeboard.gridworld.grid.
Location
NORTHEAST
- Static variable in class com.collegeboard.gridworld.grid.
Location
NORTHWEST
- Static variable in class com.collegeboard.gridworld.grid.
Location
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
putSelfInGrid(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.actor.
ActorWorld
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
remove(Location)
- Method in class com.collegeboard.gridworld.world.
World
Removes an occupant from a given location.
removeSelfFromGrid()
- Method in class com.collegeboard.gridworld.actor.
Actor
Removes an actor from a grid.
RIGHT
- Static variable in class com.collegeboard.gridworld.grid.
Location
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 class com.collegeboard.gridworld.world.
World
Sets the grid managed by this world.
setMessage(String)
- Method in class com.collegeboard.gridworld.world.
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 class com.collegeboard.gridworld.world.
World
Constructs and shows a frame for this world.
SOUTH
- Static variable in class com.collegeboard.gridworld.grid.
Location
SOUTHEAST
- Static variable in class com.collegeboard.gridworld.grid.
Location
SOUTHWEST
- Static variable in class com.collegeboard.gridworld.grid.
Location
step()
- Method in class com.collegeboard.gridworld.actor.
ActorWorld
step()
- Method in class com.collegeboard.gridworld.world.
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.
BoundedGrid
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.
toString()
- Method in class com.collegeboard.gridworld.grid.
UnboundedGrid
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 grid
W
WEST
- Static variable in class com.collegeboard.gridworld.grid.
Location
World
<
T
> - Class in
com.collegeboard.gridworld.world
A world is the mediator between a grid and the GridWorld GUI.
World()
- Constructor for class com.collegeboard.gridworld.world.
World
World(Grid<T>)
- Constructor for class com.collegeboard.gridworld.world.
World
A
B
C
D
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