|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--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. Each Direction object has two fields, x and y, each of which can be set to -1, 0, +1.
Constructor Summary | |
Direction()
constructor for an uninitialized Direction object |
|
Direction(int ix,
int iy)
constructor for an initialized Direction object |
Method Summary | |
int |
getX()
Observer for x value of a Direction object |
int |
getY()
Observer for y value of a Direction object |
Direction |
incrDirn(int i)
scales the components of a direction object by its parameter |
boolean |
isNull()
checks for (0,0) direction |
boolean |
isWithCurrent(Location ll,
World myWorld)
checks if a proposed direction is the same as an E-W or W-E current |
void |
setX(int ix)
Mutator for x value of a Direction object |
void |
setY(int iy)
Mutator for y value of a Direction object |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Direction(int ix, int iy)
ix
- - for x directioniy
- - for y directionpublic Direction()
Method Detail |
public int getX()
public int getY()
public void setX(int ix)
ix
- is value with which to set x valuepublic void setY(int iy)
iy
- is value with which to set y valuepublic boolean isNull()
public boolean isWithCurrent(Location ll, World myWorld)
ll
- is current locationmyWorld
- is current simulation objectpublic Direction incrDirn(int i)
i
- is scale factor
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |