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

A

AbstractGrid<E> - Class in info.gridworld.grid
AbstractGrid contains the methods that are common to grid implementations.
AbstractGrid() - Constructor for class info.gridworld.grid.AbstractGrid
 
act() - Method in class info.gridworld.actor.Actor
Reverses the direction of this actor.
act() - Method in class info.gridworld.actor.Bug
Moves if it can move, turns otherwise.
act() - Method in class info.gridworld.actor.Critter
A critter acts by getting a list of other actors, processing that list, getting locations to move to, selecting one of them, and moving to the selected location.
act() - Method in class info.gridworld.actor.Flower
Causes the color of this flower to darken.
act() - Method in class info.gridworld.actor.Rock
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
An ActorWorld 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 an actor to this world at a given location.
add(Actor) - Method in class info.gridworld.actor.ActorWorld
Adds an occupant at a random empty 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 location.
AHEAD - Static variable in class info.gridworld.grid.Location
The turn angle for making no turn.

B

BoundedGrid<E> - Class in info.gridworld.grid
A BoundedGrid is a rectangular grid with a finite number of rows and columns.
BoundedGrid(int, int) - Constructor for class info.gridworld.grid.BoundedGrid
Constructs an empty bounded grid 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 into a location that is empty or contains a flower.
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 other actors in some way and then moving to a new location.
Critter() - Constructor for class info.gridworld.actor.Critter
 

E

EAST - Static variable in class info.gridworld.grid.Location
The compass direction for east.
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
A Flower is an actor that darkens over time.
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
The turn angle for turning a full circle.

G

get(Location) - Method in class info.gridworld.grid.BoundedGrid
 
get(Location) - Method in interface info.gridworld.grid.Grid
Returns the object at a given location in this grid.
get(Location) - Method in class info.gridworld.grid.UnboundedGrid
 
getActors() - Method in class info.gridworld.actor.Critter
Gets the actors for processing.
getAdjacentLocation(int) - Method in class info.gridworld.grid.Location
Gets the adjacent location in any one of the eight compass directions.
getCol() - Method in class info.gridworld.grid.Location
Gets the column coordinate.
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.
getDirectionToward(Location) - Method in class info.gridworld.grid.Location
Returns the direction from this location toward another location.
getEmptyAdjacentLocations(Location) - Method in class info.gridworld.grid.AbstractGrid
 
getEmptyAdjacentLocations(Location) - Method in interface info.gridworld.grid.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 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.
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
Gets a list of possible locations for the next move.
getNeighbors(Location) - Method in class info.gridworld.grid.AbstractGrid
 
getNeighbors(Location) - Method in interface info.gridworld.grid.Grid
Gets the neighboring occupants in all eight compass directions (north, northeast, east, southeast, south, southwest, west, and northwest).
getNumCols() - Method in class info.gridworld.grid.BoundedGrid
 
getNumCols() - Method in interface info.gridworld.grid.Grid
Returns the number of columns in this grid.
getNumCols() - Method in class info.gridworld.grid.UnboundedGrid
 
getNumRows() - Method in class info.gridworld.grid.BoundedGrid
 
getNumRows() - Method in interface info.gridworld.grid.Grid
Returns the number of rows in this grid.
getNumRows() - Method in class info.gridworld.grid.UnboundedGrid
 
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.
getOccupiedAdjacentLocations(Location) - Method in class info.gridworld.grid.AbstractGrid
 
getOccupiedAdjacentLocations(Location) - Method in interface info.gridworld.grid.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 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
 
getRandomEmptyLocation() - Method in class info.gridworld.world.World
Gets a random empty location in this world.
getRow() - Method in class info.gridworld.grid.Location
Gets the row coordinate.
getValidAdjacentLocations(Location) - Method in class info.gridworld.grid.AbstractGrid
 
getValidAdjacentLocations(Location) - Method in interface info.gridworld.grid.Grid
Gets the valid locations adjacent to a given location in all eight compass directions (north, northeast, east, southeast, south, southwest, west, and northwest).
Grid<E> - Interface in info.gridworld.grid
Grid provides an interface for a two-dimensional, grid-like environment containing arbitrary objects.

H

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

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
 

K

keyPressed(String, Location) - Method in class info.gridworld.world.World
This method is called when a key was pressed.

L

LEFT - Static variable in class info.gridworld.grid.Location
The turn angle for turning 90 degrees to the left.
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 with given row and column coordinates.
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 loc, or removes this critter from its grid if loc is null.
move() - Method in class info.gridworld.actor.Bug
Moves the bug forward, putting a flower into the location it previously occupied.
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
The compass direction for north.
NORTHEAST - Static variable in class info.gridworld.grid.Location
The compass direction for northeast.
NORTHWEST - Static variable in class info.gridworld.grid.Location
The compass direction for northwest.

P

processActors(ArrayList<Actor>) - Method in class info.gridworld.actor.Critter
Processes the elements of actors.
put(Location, E) - Method in class info.gridworld.grid.BoundedGrid
 
put(Location, E) - Method in interface info.gridworld.grid.Grid
Puts an object at a given location in 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 the object at a given location 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 this actor from its grid.
RIGHT - Static variable in class info.gridworld.grid.Location
The turn angle for turning 90 degrees to the right.
Rock - Class in info.gridworld.actor
A Rock is an actor that does nothing.
Rock() - Constructor for class info.gridworld.actor.Rock
Constructs a black rock.
Rock(Color) - Constructor for class info.gridworld.actor.Rock
Constructs a rock of a given color.

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.actor.ActorWorld
 
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
The compass direction for south.
SOUTHEAST - Static variable in class info.gridworld.grid.Location
The compass direction for southeast.
SOUTHWEST - Static variable in class info.gridworld.grid.Location
The compass direction for southwest.
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
Creates a string that describes this actor.
toString() - Method in class info.gridworld.grid.AbstractGrid
Creates a string that describes this grid.
toString() - Method in class info.gridworld.grid.Location
Creates a string that describes this location.
toString() - Method in class info.gridworld.world.World
Returns a string that shows the positions of the grid occupants.
turn() - Method in class info.gridworld.actor.Bug
Turns the bug 45 degrees to the right without changing its location.

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 unbounded grid.

W

WEST - Static variable in class info.gridworld.grid.Location
The compass direction for west.
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 E F G H I K L M N P R S T U W