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

A

AbstractGrid<E> - Class in info.gridworld.grid
This class contains the methods that are common to all grid implementations.
AbstractGrid() - Constructor for class info.gridworld.grid.AbstractGrid
 
act() - Method in class info.gridworld.actor.Actor
Override this method to define the action of this actor.
act() - Method in class info.gridworld.actor.Bug
 
act() - Method in class info.gridworld.actor.Critter
A critter acts by getting a list of its neighbors, processing them, getting locations to move to, selecting one of them, and moving to the selected location.
act() - Method in class info.gridworld.actor.Flower
When a flower acts, it "wilts", gradually losing its color.
act() - Method in class info.gridworld.actor.Rock
This method overrides the act method in the Actor class to do nothing.
Actor - Class in info.gridworld.actor
An Actor is an entity with a color and direction that can act.
Actor() - Constructor for class info.gridworld.actor.Actor
Constructs a blue actor that is facing north.
ActorWorld - Class in info.gridworld.actor
A world that is occupied by actors.
ActorWorld() - Constructor for class info.gridworld.actor.ActorWorld
Constructs an actor world with a default grid.
ActorWorld(Grid<Actor>) - Constructor for class info.gridworld.actor.ActorWorld
Constructs an actor world with a given grid.
add(Location, Actor) - Method in class info.gridworld.actor.ActorWorld
Adds a actor to this world at a given location.
add(T) - Method in class info.gridworld.world.World
Adds an occupant at a random location.
add(Location, T) - Method in class info.gridworld.world.World
Adds an occupant at a given location.
addGridClass(String) - Method in class info.gridworld.world.World
Adds a class to be shown in the "Set grid" menu.
addOccupantClass(String) - Method in class info.gridworld.world.World
Adds a class to be shown when clicking on an empty cell
AHEAD - Static variable in class info.gridworld.grid.Location
 

B

BoundedGrid<E> - Class in info.gridworld.grid
 
BoundedGrid(int, int) - Constructor for class info.gridworld.grid.BoundedGrid
Constructs an empty BoundedGrid object with the given dimensions.
Bug - Class in info.gridworld.actor
A bug is an actor that can move and turn.
Bug() - Constructor for class info.gridworld.actor.Bug
Constructs a red bug.
Bug(Color) - Constructor for class info.gridworld.actor.Bug
Constructs a bug of a given color.

C

canMove() - Method in class info.gridworld.actor.Bug
Tests whether this bug can move forward.
col() - Method in class info.gridworld.grid.Location
Returns the column coordinate of this location.
compareTo(Object) - Method in class info.gridworld.grid.Location
Compares this location to other for ordering.
Critter - Class in info.gridworld.actor
A critter is an actor that moves through its world, processing its neighbors in some way and then picking a new location.
Critter() - Constructor for class info.gridworld.actor.Critter
 

D

directionToward(Location) - Method in class info.gridworld.grid.Location
Returns the direction from this location toward another location

E

EAST - Static variable in class info.gridworld.grid.Location
 
equals(Object) - Method in class info.gridworld.grid.Location
Indicates whether some other Location object is "equal to" this one.

F

Flower - Class in info.gridworld.actor
Some actors drop flowers as they move.
Flower() - Constructor for class info.gridworld.actor.Flower
Constructs a pink flower.
Flower(Color) - Constructor for class info.gridworld.actor.Flower
Constructs a flower of a given color.
FULL_CIRCLE - Static variable in class info.gridworld.grid.Location
 

G

get(Location) - Method in class info.gridworld.grid.BoundedGrid
 
get(Location) - Method in interface info.gridworld.grid.Grid
Returns the object at a specific location in this grid
get(Location) - Method in class info.gridworld.grid.UnboundedGrid
 
getActors() - Method in class info.gridworld.actor.Critter
Get the actors for processing.
getColor() - Method in class info.gridworld.actor.Actor
Gets the color of this actor.
getDirection() - Method in class info.gridworld.actor.Actor
Gets the current direction of this actor.
getEmptyNeighborLocations(Location) - Method in class info.gridworld.grid.AbstractGrid
Gets the locations of the empty neighbors in all directions (north, northeast, east, southeast, south, southwest, west, and northwest)
getEmptyNeighborLocations(Location) - Method in interface info.gridworld.grid.Grid
 
getGrid() - Method in class info.gridworld.actor.Actor
Gets the grid in which this actor is located
getGrid() - Method in class info.gridworld.world.World
Gets the grid managed by this world.
getGridClasses() - Method in class info.gridworld.world.World
Gets a set of grid classes that should be used by the world frame for this world.
getLocation() - Method in class info.gridworld.actor.Actor
Gets the location of this actor
Precondition: This actor is in a grid
getMessage() - Method in class info.gridworld.world.World
Gets the message to be displayed in the world frame above the grid.
getMoveLocations() - Method in class info.gridworld.actor.Critter
Get the possible locations for the next move.
getNeighborLocation(int) - Method in class info.gridworld.grid.Location
Gets the neighbor location in the given direction
getNeighbors(Location) - Method in class info.gridworld.grid.AbstractGrid
Gets the neighboring occupants in all directions (north, northeast, east, southeast, south, southwest, west, and northwest)
getNeighbors(Location) - Method in interface info.gridworld.grid.Grid
 
getOccupantClasses() - Method in class info.gridworld.world.World
Gets a set of occupant classes that should be used by the world frame for this world.
getOccupiedLocations() - Method in class info.gridworld.grid.BoundedGrid
 
getOccupiedLocations() - Method in interface info.gridworld.grid.Grid
Gets the locations in this grid that contain objects.
getOccupiedLocations() - Method in class info.gridworld.grid.UnboundedGrid
 
getOccupiedNeighborLocations(Location) - Method in class info.gridworld.grid.AbstractGrid
Gets the locations of the occupied neighbors in all directions (north, northeast, east, southeast, south, southwest, west, and northwest)
getOccupiedNeighborLocations(Location) - Method in interface info.gridworld.grid.Grid
 
getValidNeighborLocations(int[]) - Method in class info.gridworld.actor.Critter
Gets the valid neighbor locations of this critter in different directions
getValidNeighborLocations(Location) - Method in class info.gridworld.grid.AbstractGrid
Gets the valid locations of the neighbors in all directions (north, northeast, east, southeast, south, southwest, west, and northwest)
getValidNeighborLocations(Location) - Method in interface info.gridworld.grid.Grid
 
Grid<E> - Interface in info.gridworld.grid
 

H

HALF_CIRCLE - Static variable in class info.gridworld.grid.Location
 
HALF_LEFT - Static variable in class info.gridworld.grid.Location
 
HALF_RIGHT - Static variable in class info.gridworld.grid.Location
 
hashCode() - Method in class info.gridworld.grid.Location
Generates a hash code for this location (will not be tested on the Advanced Placement exam).

I

info.gridworld.actor - package info.gridworld.actor
 
info.gridworld.grid - package info.gridworld.grid
 
info.gridworld.world - package info.gridworld.world
 
isValid(Location) - Method in class info.gridworld.grid.BoundedGrid
 
isValid(Location) - Method in interface info.gridworld.grid.Grid
Checks whether a location is valid in this grid.
isValid(Location) - Method in class info.gridworld.grid.UnboundedGrid
 

L

LEFT - Static variable in class info.gridworld.grid.Location
 
Location - Class in info.gridworld.grid
A Location object represents the row and column of a location in a two-dimensional grid.
Location(int, int) - Constructor for class info.gridworld.grid.Location
Constructs a Location object.
locationClicked(Location) - Method in class info.gridworld.world.World
This method is called when the user clicks on a location in the WorldFrame.

M

makeMove(Location) - Method in class info.gridworld.actor.Critter
Moves this critter to the given location.
move() - Method in class info.gridworld.actor.Bug
Moves this bug forward.
moveTo(Location) - Method in class info.gridworld.actor.Actor
Moves this actor to a new location.

N

NORTH - Static variable in class info.gridworld.grid.Location
 
NORTHEAST - Static variable in class info.gridworld.grid.Location
 
NORTHWEST - Static variable in class info.gridworld.grid.Location
 
numCols() - Method in class info.gridworld.grid.BoundedGrid
 
numCols() - Method in interface info.gridworld.grid.Grid
Returns number of columns in this grid.
numCols() - Method in class info.gridworld.grid.UnboundedGrid
 
numRows() - Method in class info.gridworld.grid.BoundedGrid
 
numRows() - Method in interface info.gridworld.grid.Grid
Returns number of rows in this grid.
numRows() - Method in class info.gridworld.grid.UnboundedGrid
 

P

processActors(ArrayList<Actor>) - Method in class info.gridworld.actor.Critter
Process the actors.
put(Location, E) - Method in class info.gridworld.grid.BoundedGrid
 
put(Location, E) - Method in interface info.gridworld.grid.Grid
Adds a new object to this grid.
put(Location, E) - Method in class info.gridworld.grid.UnboundedGrid
 
putSelfInGrid(Grid<Actor>, Location) - Method in class info.gridworld.actor.Actor
Puts this actor into a grid.

R

remove(Location) - Method in class info.gridworld.actor.ActorWorld
Removes an actor from this world.
remove(Location) - Method in class info.gridworld.grid.BoundedGrid
 
remove(Location) - Method in interface info.gridworld.grid.Grid
Removes an object from this grid.
remove(Location) - Method in class info.gridworld.grid.UnboundedGrid
 
remove(Location) - Method in class info.gridworld.world.World
Removes an occupant from a given location.
removeSelfFromGrid() - Method in class info.gridworld.actor.Actor
Removes an actor from a grid.
RIGHT - Static variable in class info.gridworld.grid.Location
 
Rock - Class in info.gridworld.actor
A rock is an actor that does nothing.
Rock() - Constructor for class info.gridworld.actor.Rock
 
row() - Method in class info.gridworld.grid.Location
Returns the row coordinate of this location.

S

selectMoveLocation(ArrayList<Location>) - Method in class info.gridworld.actor.Critter
Selects the location for the next move.
setColor(Color) - Method in class info.gridworld.actor.Actor
Sets the color of this actor.
setDirection(int) - Method in class info.gridworld.actor.Actor
Sets the current direction of this actor.
setGrid(Grid<T>) - Method in class info.gridworld.world.World
Sets the grid managed by this world.
setMessage(String) - Method in class info.gridworld.world.World
Sets the message to be displayed in the world frame above the grid.
show() - Method in class info.gridworld.world.World
Constructs and shows a frame for this world.
SOUTH - Static variable in class info.gridworld.grid.Location
 
SOUTHEAST - Static variable in class info.gridworld.grid.Location
 
SOUTHWEST - Static variable in class info.gridworld.grid.Location
 
step() - Method in class info.gridworld.actor.ActorWorld
 
step() - Method in class info.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 info.gridworld.actor.Actor
 
toString() - Method in class info.gridworld.grid.AbstractGrid
Creates a string representing all the objects in this grid (not necessarily in any particular order).
toString() - Method in class info.gridworld.grid.Location
Represents this location as a string.
turn() - Method in class info.gridworld.actor.Bug
Makes this bug turn by 45 degrees to the right.

U

UnboundedGrid<E> - Class in info.gridworld.grid
An UnboundedGrid is a rectangular grid with an unbounded number of rows and columns.
UnboundedGrid() - Constructor for class info.gridworld.grid.UnboundedGrid
Constructs an empty grid

W

WEST - Static variable in class info.gridworld.grid.Location
 
World<T> - Class in info.gridworld.world
A world is the mediator between a grid and the GridWorld GUI.
World() - Constructor for class info.gridworld.world.World
 
World(Grid<T>) - Constructor for class info.gridworld.world.World
 

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