|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--WorldGrid
This class provides a representation for the simulation (World)
Method Summary | |
Animal |
getElem(int x,
int y)
observer of elements of WorldGrid |
Animal |
getElem(Location loc)
observer of elements of WorldGrid |
LocationObjectPair |
getGridElement(Location loc)
observer of WorldGrid; |
void |
setElem(int x,
int y,
Animal obj)
mutator of WorldGrid; stores reference to object obj at location x,y |
void |
setElem(Location loc,
Animal obj)
mutator of WorldGrid; stores reference to object obj at Location loc |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public final Animal getElem(Location loc)
loc
- is location whose occupant is requestedpublic final Animal getElem(int x, int y)
x
- is x co-ord of location whose occupant is requestedy
- is y co-ord of location whose occupant is requestedpublic final void setElem(Location loc, Animal obj)
loc
- is location to be wrappedobj
- is Animal reference to be stored at wrapped locationpublic final void setElem(int x, int y, Animal obj)
x
- is x co-ordinate of locationy
- is y co-ordiante of locationobj
- is reference to be stored at locationpublic final LocationObjectPair getGridElement(Location loc)
loc
- is location in simulation
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |