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

A

addTo(Object) - Method in class LinkedList
Add an Object to the end of the LinkedList
addTo(Object) - Method in class Set
Add an object to the Set.
Anemone - class Anemone.
This class provides ability to print A for anemone objects and creates new Anemone objects for reproduction
Anemone() - Constructor for class Anemone
 
Animal - class Animal.
abstract class at root of shore animal hierarchy provides functionality for animal ages and when they die also defines abstract methods makeMove() and getPrintChar() field int age - animal's age (private) field int maxAge - maximun age this animal can attain (private)

B

Barnacle - class Barnacle.
This class provides ability to print B for Barnacle objects and creates new Barnacle objects for reproduction
Barnacle() - Constructor for class Barnacle
 
buds() - Method in interface ReproducesbyBudding
determines number of offspring surviving birth and infancy
buds() - Method in class ShortLivedSessile
method uses random number generator to select how many offspring of short-lived sessile animal survive; current settings are 30% 0 survivors, 30% 1 survivor; 40% 2 survivors

C

clone() - Method in class Set
We will make a clone of a Set.
Crab - class Crab.
This class provides ability to print C for Crab objects, creates new Crab objects for reproduction, and initializes speed field for Crab objects

D

Direction - class Direction.
This class provides encapsulation a neighborhood in the simulation A neighborhood of a point is like a tic-tac-toe board with the point in in the middle.
Direction() - Constructor for class Direction
constructor for an uninitialized Direction object
Direction(int, int) - Constructor for class Direction
constructor for an initialized Direction object
DirectionIter - class DirectionIter.
This class provides an iterator for the neighborhood of a point in the simulation.

F

FastMover - class FastMover.
abstract class which sets the maximum age of all fast moving animals, defines makeMove() and laysEggs() for all fast moving animals currently Crab, Shrimp, Starfish

G

getAge() - Method in class Animal
observer of animal's age
getChar(int, int) - Method in class World
this method returns the character representation of the Animal which is at position
getCurrent() - Method in class World
observer for current
getCurrentTimeStep() - Method in class World
observer for time
getData() - Method in class LinkedListNode
Get the Object stored in the LinkedListNode
getDirection() - Method in class MovingAnimal
method provided to pick next direction to try to move each direction equally likely; only available to descendent classes
getElem(int, int) - Method in class WorldGrid
observer of elements of WorldGrid
getElem(Location) - Method in class WorldGrid
observer of elements of WorldGrid
getFirstNode() - Method in class LinkedList
Get the first LinkedListNode on a LinkedList
getGridElement(Location) - Method in class WorldGrid
observer of WorldGrid;
getList() - Method in class Set
Return the LinkedList which holds this Set
getLocation() - Method in class LocationObjectPair
observer for location
getmaxAge() - Method in class Animal
observer of animal's maximum age; can be called by simulation clients
getNewFastMover() - Method in class Crab
provides new Crab object for reproduction function in ancestor class
getNewFastMover() - Method in class FastMover
abstract method forces all actual animal descendent classes of FastMover to define a method that returns a new animal of their kind; allows laysEggs() to be inherited by all these classes
getNewFastMover() - Method in class Shrimp
provides new Shrimp object for reproduction function in ancestor class
getNewFastMover() - Method in class Starfish
provides new Starfish object for reproduction function in ancestor class
getNewLongLivedSessile() - Method in class Barnacle
provides new Barnacle object for reproduction function in ancestor class
getNewLongLivedSessile() - Method in class Oyster
provides new Oyster object for reproduction function in ancestor class
getNewShortLivedSessile() - Method in class Anemone
provides new Anemone object for reproduction function in ancestor class
getNewShortLivedSessile() - Method in class Hydroid
provides new Hydroid object for reproduction function in ancestor class
getNewShortLivedSessile() - Method in class ShortLivedSessile
abstract method forces all actual animal descendent classes of ShortLivedSessile to define a method that returns a new animal of their kind; allows buds() to be inherited by all these classes
getNext() - Method in class LinkedListNode
Get the next node in the LinkedList, possibly null
getObject() - Method in class LocationObjectPair
observer for object; need to change return type
getPrintChar() - Method in class Anemone
provides print character for Anemone object
getPrintChar() - Method in class Animal
function returns printable character representation of animal
getPrintChar() - Method in class Barnacle
provides print character for Barnacle object
getPrintChar() - Method in class Crab
provides print character for Crab object
getPrintChar() - Method in class Hydroid
provides print character for Hydroid object
getPrintChar() - Method in class Oyster
provides print character for Oyster object
getPrintChar() - Method in class Seahorse
provides print character for Seahorse object
getPrintChar() - Method in class Shrimp
provides print character for Shrimp object
getPrintChar() - Method in class Starfish
provides print character for Starfish object
getSpeed() - Method in class MovingAnimal
observer for speed field; accessible to clients
getWorldGrid() - Method in class World
observer for worldGrid
getWorldSize() - Method in class World
observer for worldSize
getX() - Method in class Direction
Observer for x value of a Direction object
getX() - Method in class Location
 
getY() - Method in class Direction
Observer for y value of a Direction object
getY() - Method in class Location
observer for y co-ordinate
Gui - class Gui.
 
Gui(String[]) - Constructor for class Gui
 

H

hasMoreElements() - Method in class LinkedListEnumeration
Tests if this enumeration contains more elements.
hasMoreElements() - Method in class SetEnumeration
Tests if this enumeration contains more elements.
hasMoreElements() - Method in class WorldEnumeration
checks if there are more LocationObjectPairs to return
Hydroid - class Hydroid.
This class provides ability to print Y for Hydroid objects and creates new Hydroid objects for reproduction
Hydroid() - Constructor for class Hydroid
 

I

incrAge() - Method in class Animal
mutator of animal's age; can be called by simulation clients
incrDirn(int) - Method in class Direction
scales the components of a direction object by its parameter
isEmpty() - Method in class LinkedList
See if a LinkedList is empty.
isEmpty() - Method in class Set
See if the Set is empty.
isNull() - Method in class Direction
checks for (0,0) direction
isWithCurrent(Location, World) - Method in class Direction
checks if a proposed direction is the same as an E-W or W-E current

L

laysEggs() - Method in class FastMover
method uses random number generator to select how many offspring of fast moving animal survive; current settings are 60% 0 survivors, 30% 1 survivor, 10$ 2 survivors.
laysEggs() - Method in class LongLivedSessile
method uses random number generator to select how many offspring of long-lived sessile animal survive; current settings are 50% 0 survivors, 50% 1 survivor;
laysEggs() - Method in interface ReproducesbyEggs
determines number of offspring surviving birth and infancy
laysEggs() - Method in class Seahorse
method for reproducing by laying eggs; always lays 1 egg per reproduction period
LinkedList - class LinkedList.
This class is used for implementing a queue as a linked list.
LinkedList() - Constructor for class LinkedList
Create an new LinkedList, initially empty.
LinkedListEnumeration - class LinkedListEnumeration.
This provides a way to enumerate over a linked list.
LinkedListEnumeration(LinkedList) - Constructor for class LinkedListEnumeration
Creates a new LinkedListEnumeration
LinkedListNode - class LinkedListNode.
This is a node in a linked list.
LinkedListNode(Object) - Constructor for class LinkedListNode
Create a new LinkedListNode to hold the diven object.
Location - class Location.
class that represents a location in the simulation
Location() - Constructor for class Location
constructor of Location (0,0)
Location(int, int) - Constructor for class Location
copy constructor for Location
LocationObjectPair - class LocationObjectPair.
This class provides encapsulation for an object in the simulation and its location.
LocationObjectPair(Location, Animal) - Constructor for class LocationObjectPair
Copy constructor
LongLivedSessile - class LongLivedSessile.
abstract class which defines laysEggs() for all long-lived sessile animals

M

main(String[]) - Static method in class Gui
 
makeMove(Location, World) - Method in class Animal
function returns new Location (position) to move to for an animal; if there is nowhere legal to move, then the function returns null; if an animal is sessile, then the function returns null;
makeMove(Location, World) - Method in class FastMover
method implements movement for all fast moving animals first a direction is picked and then multiplied by the scale factor (speed field) of this animal; this Location is checked to see if it is free.
makeMove(Location, World) - Method in class Seahorse
function provides a new Location to which the Seahorse object can move; checks that it moves with the current note: chose to try 8 randomly chosen directions
makeMove(Location, World) - Method in class Sessile
 
memberOf(Object) - Method in class Set
See if an Object is a member of a Set
MovingAnimal - class MovingAnimal.
abstract class which stores a speed field for all moving animals, defines mutator and observer for speed field, defines getDirection() method for us in calculating makeMove() in descendent classes including FastMover and Seahorse; field int speed - stores speed of movement of an animal
MovingAnimal() - Constructor for class MovingAnimal
 

N

next() - Method in class DirectionIter
creates next Direction to return and generates the components of the next Direction; halts when has exhausted all directions.
nextElement() - Method in class LinkedListEnumeration
Returns the next element of this enumeration.
nextElement() - Method in class SetEnumeration
Returns the next element of this enumeration.
nextElement() - Method in class WorldEnumeration
returns either next LocationObjectPair from iterator or null
nextTimeStep() - Method in class World
This method simply iterates through all objects in the World and calls processTimeStepForObject(obj,loc) on each object Gui.main() calls this nextTimeStep function for each time step in the simulation

O

Oyster - class Oyster.
This class provides ability to print O for Oyster objects and creates new Oyster objects for reproduction
Oyster() - Constructor for class Oyster
 

P

paint(Graphics) - Method in class Gui
 
plus(Direction) - Method in class Location
method enables addition of a direction to a location
populate(int) - Method in class World
this function places Animals in the World called by Gui.main() needs to be rewritten for every simulation
processMouseEvent(MouseEvent) - Method in class Gui
 

R

removeFrom() - Method in class LinkedList
Remove an Object from the front of the LinkedList.
ReproducesbyBudding - interface ReproducesbyBudding.
interface defines function for reproduction by budding in neighborhood of dweller
ReproducesbyEggs - interface ReproducesbyEggs.
interface defines function for egg reproduction in neighborhood of dweller
run() - Method in class Gui
 

S

Seahorse - class Seahorse.
This class provides ability to print H for Seahorse objects, defines makeMove() and laysEggs() for Seahorses
Sessile - class Sessile.
abstract class which defines makeMove() for all sessile animals
Sessile() - Constructor for class Sessile
 
Set - class Set.
Implements a Set using a cs111.LinkedList.
Set() - Constructor for class Set
Create a new Set, initially empty.
Set(Set) - Constructor for class Set
Create a new Set with the same elements as in the given set.
setElem(int, int, Animal) - Method in class WorldGrid
mutator of WorldGrid; stores reference to object obj at location x,y
setElem(Location, Animal) - Method in class WorldGrid
mutator of WorldGrid; stores reference to object obj at Location loc
SetEnumeration - class SetEnumeration.
This provides a way to enumerate over a set.
SetEnumeration(Set) - Constructor for class SetEnumeration
Creates a new SetEnumeration
setmaxAge(int) - Method in class Animal
mutator of animal's maximum age; called by descendent classes
setNext(LinkedListNode) - Method in class LinkedListNode
Make this LinkedListNode next pointer point to the given node.
setSpeed(int) - Method in class MovingAnimal
mutator for speed field; only accessible to descendent classes
setX(int) - Method in class Direction
Mutator for x value of a Direction object
setX(int) - Method in class Location
mutator for x co-ordinate
setY(int) - Method in class Direction
Mutator for y value of a Direction object
setY(int) - Method in class Location
mutator for y co-ordinate
ShortLivedSessile - class ShortLivedSessile.
abstract class which defines buds() for all short-lived sessile animals
Shrimp - class Shrimp.
This class provides ability to print R for Shrimp objects, creates new Shrimp objects for reproduction, and initializes speed field for Shrimp objects
Starfish - class Starfish.
This class provides ability to print S for Starfish objects, creates new Starfish objects for reproduction, and initializes speed field for Starfish objects

T

timeToDie() - Method in class Animal
function calculates whether or not the animal attains its maximum age on this time step; if so then it dies; if not it survives
toString() - Method in class LinkedList
Print out a string representation of a LinkedList.
toString() - Method in class LinkedListNode
Return the string representation of this LinkedListNode.
toString() - Method in class Set
Return a String representation of a Set.

W

whatIs(Location) - Method in class World
function checks location loc in simulation
World - class World.
This class is the simulation object; Animal is the root class of the dweller hierarchy provided by the user worldGrid is the representation of the World object there are worldSize*worldSize points in the World current is the encoded direction of the ocean current time is the current time step kint sets the interval of steps on which reproduction is tried timeStep is a static variable to keep track of number of time steps so far in the World simulation.
WorldEnumeration - class WorldEnumeration.
This class provides an iterator for the simulation (World)
WorldGrid - class WorldGrid.
This class provides a representation for the simulation (World)

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