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

A

add(Locatable) - Method in class BoundedEnv
Adds a new object to this environment at the location it specifies.
add(Locatable) - Method in interface Environment
Adds a new object to this environment at the location it specifies.
adjust(Locatable, Component, Graphics2D) - Method in class ScaledImageDisplay
Adjusts the graphics system for drawing an object, as appropriate.
allObjects() - Method in class BoundedEnv
Returns all the objects in this environment.
allObjects() - Method in interface Environment
Returns all the objects in this environment.
associate(String, LocatableDisplay) - Static method in class DisplayMap
Associates a display object with an environment object class.

B

BoundedEnv - class BoundedEnv.
AP® Computer Science Marine Biology Simulation:
The BoundedEnv class models a bounded, two-dimensional, grid-like environment containing locatable objects.
BoundedEnv(int, int) - Constructor for class BoundedEnv
Constructs an empty BoundedEnv object with the given dimensions.

C

col() - Method in class Location
Returns the column coordinate of this location.
color() - Method in class ColorBlock
Gets color value for color block.
ColorBlock - class ColorBlock.
Environment-Based Applications:
A ColorBlock object encapsulates a color for a colored cell in an environment.
ColorBlock(Color, Environment, Location) - Constructor for class ColorBlock
Constructs a color block with the specified color.
ColorBlockDisplay - class ColorBlockDisplay.
Environment-Based Applications:
A ColorBlockDisplay object displays a ColorBlock object in an environment.
ColorBlockDisplay() - Constructor for class ColorBlockDisplay
 
compareTo(Object) - Method in class Location
Compares this location to other for ordering.

D

Debug - class Debug.
AP® Computer Science Marine Biology Simulation:
The Debug class supports conditional printing of debugging messages.
Debug() - Constructor for class Debug
 
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() - 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.
DisplayMap - class DisplayMap.
AP® Computer Science Marine Biology Simulation:
DisplayMap is a collection that maps environment object classes to objects that know how to display them.
DisplayMap() - Constructor for class DisplayMap
 
draw(Locatable, Component, Graphics2D) - Method in class ColorBlockDisplay
Draw the given object (color block).
draw(Locatable, Component, Graphics2D) - Method in class ScaledImageDisplay
Draws a unit-length object using an image.

E

EAST - Static variable in class Direction
 
EnvDisplay - interface EnvDisplay.
AP® Computer Science Marine Biology Simulation:
The EnvDisplay interface describes the methods needed by all EnvDisplay objects.
Environment - interface Environment.
AP® Computer Science Marine Biology Simulation:
Environment provides an interface for a two-dimensional, grid-like environment containing locatable objects.
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

findDisplayFor(Locatable) - Static method in class DisplayMap
Finds a display class that knows how to display the given object.
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.
getDirection(Location, Location) - Method in class SquareEnvironment
Returns the direction from one location to another.
getNeighbor(Location, Direction) - Method in interface Environment
Returns the adjacent neighbor (whether valid or invalid) of a location in the specified direction.
getNeighbor(Location, Direction) - Method in class SquareEnvironment
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 class BoundedEnv
Determines whether a specific location in this environment is empty.
isEmpty(Location) - Method in interface Environment
Determines whether a specific location in this environment is empty.
isOff() - Static method in class Debug
Checks whether debugging is off.
isOn() - Static method in class Debug
Checks whether debugging is on.
isValid(Location) - Method in class BoundedEnv
Verifies whether a location is valid in this environment.
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 class ColorBlock
Gets color block's location.
location() - Method in interface Locatable
Returns the location of this object.
Location(int, int) - Constructor for class Location
Constructs a Location object.

M

main(String[]) - Static method in class NQueensLab
Start the 2-D Traversal Algorithms program.

N

neighborsOf(Location) - Method in interface Environment
Returns the adjacent neighbors of a specified location.
neighborsOf(Location) - Method in class SquareEnvironment
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
 
NQueens - class NQueens.
Environment-Based Applications:
The NQueens class implements the N Queens problem.
NQueens(int, SettableEnvDisplay) - Constructor for class NQueens
Constructs an object that solves the N Queens Problem.
NQueensLab - class NQueensLab.
Environment-Based Applications:
The NQueensLab class implements the N Queens problem.
NQueensLab() - Constructor for class NQueensLab
 
numAdjacentNeighbors() - Method in interface Environment
Returns the number of adjacent neighbors around each cell.
numAdjacentNeighbors() - Method in class SquareEnvironment
Returns the number of adjacent neighbors around each cell.
numCellSides() - Method in interface Environment
Returns the number of sides around each cell.
numCellSides() - Method in class SquareEnvironment
Returns the number of sides around each cell.
numCols() - Method in class BoundedEnv
Returns number of columns in the environment.
numCols() - Method in interface Environment
Returns number of columns in this environment.
numObjects() - Method in class BoundedEnv
Returns the number of objects in this environment.
numObjects() - Method in interface Environment
Returns the number of objects in this environment.
numQueens() - Method in class NQueens
Returns the number of queens to be placed on the board.
numRows() - Method in class BoundedEnv
Returns number of rows in the environment.
numRows() - Method in interface Environment
Returns number of rows in this environment.

O

objectAt(Location) - Method in class BoundedEnv
Returns the object at a specific location in this environment.
objectAt(Location) - Method in interface Environment
Returns the object at a specific location in this environment.

P

print(String) - Static method in class Debug
Prints debugging message without appending a newline character at the end.
println(String) - Static method in class Debug
Prints debugging message, appending a newline character at the end.

Q

Queen - class Queen.
Environment-Based Applications:
A Queen object represents a queen in the N Queens Problem.
Queen(Environment, Location) - Constructor for class Queen
Constructs a queen at the specified location on an N x N "chessboard."

R

randomDirection() - Static method in class Direction
Returns a random direction.
randomDirection() - Method in interface Environment
Generates a random direction.
randomDirection() - Method in class SquareEnvironment
Generates a random direction.
recordMove(Locatable, Location) - Method in class BoundedEnv
Updates this environment to reflect the fact that an object moved.
recordMove(Locatable, Location) - Method in interface Environment
Updates this environment to reflect the fact that an object moved.
remove(Locatable) - Method in class BoundedEnv
Removes the object from this environment.
remove(Locatable) - Method in interface Environment
Removes the object from this environment.
restoreState() - Static method in class Debug
Restores the previous debugging state.
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

ScaledImageDisplay - class ScaledImageDisplay.
Environment-Based Applications:
A ScaledImageDisplay uses an image read from a file to represent an object with a location in an environment.
ScaledImageDisplay(String) - Constructor for class ScaledImageDisplay
Constructs an object that knows how to display a Locatable object as an image.
setQueenColor(Color) - Static method in class Queen
Defines the color to make all queens.
showEnv() - Method in interface EnvDisplay
Shows the current state of the environment.
solve() - Method in class NQueens
Solves (or attempts to solve) the N Queens Problem.
SOUTH - Static variable in class Direction
 
SOUTHEAST - Static variable in class Direction
 
SOUTHWEST - Static variable in class Direction
 
SquareEnvironment - class SquareEnvironment.
AP® Computer Science Marine Biology Simulation:
SquareEnvironment is an abstract class that implements only the navigational methods in the Environment interface.
SquareEnvironment() - Constructor for class SquareEnvironment
Constructs a SquareEnvironment object in which cells have four adjacent neighbors -- those with which they share sides.
SquareEnvironment(boolean) - Constructor for class SquareEnvironment
Constructs a SquareEnvironment object in which cells have four or eight adjacent neighbors, depending on the value of the includeDiagonalNeighbors parameter.

T

tint(Locatable, Component, Graphics2D) - Method in class ScaledImageDisplay
Adjusts the graphics system to use an object's color to tint an image.
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 BoundedEnv
Creates a single string representing all the objects in this environment (not necessarily in any particular order).
toString() - Method in class Direction
Represents this direction as a string.
toString() - Method in class Location
Represents this location as a string.
turnOff() - Static method in class Debug
Turns debugging off.
turnOn() - Static method in class Debug
Turns debugging on.

W

WEST - Static variable in class Direction
 

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