Class Location

java.lang.Object
  |
  +--Location

public class Location
extends java.lang.Object

class that represents a location in the simulation


Constructor Summary
Location()
          constructor of Location (0,0)
Location(int ix, int iy)
          copy constructor for Location
 
Method Summary
 int getX()
           
 int getY()
          observer for y co-ordinate
 Location plus(Direction d)
          method enables addition of a direction to a location
 void setX(int ix)
          mutator for x co-ordinate
 void setY(int iy)
          mutator for y co-ordinate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Location

public Location(int ix,
                int iy)
copy constructor for Location
Parameters:
ix - is x co-ordinate
iy - is y co-ordinate

Location

public Location()
constructor of Location (0,0)
Method Detail

getX

public int getX()

getY

public int getY()
observer for y co-ordinate
Returns:
value of y co-ordinate

setX

public void setX(int ix)
mutator for x co-ordinate
Parameters:
ix - is value for x co-ordinate

setY

public void setY(int iy)
mutator for y co-ordinate
Parameters:
iy - is value for y co-ordinate

plus

public Location plus(Direction d)
method enables addition of a direction to a location
Parameters:
d - is direction to be added (has x and y portions)
Returns:
new Location obtained