Class IdentifiedWithPosition

java.lang.Object
  |
  +--IdentifiedWithPosition
Direct Known Subclasses:
Command, Package, SimpleRobot

public class IdentifiedWithPosition
extends java.lang.Object

This class is as the name says identified, it has an integer as identifier, its common to the robot and the packages classes.

See Also:
SimpleRobot, Package

Field Summary
protected  int id
          the integer with wich we're identified :)
protected  int x_pos
          The x cordinate of the Object
protected  int y_pos
          The y cordinate of the Object
 
Constructor Summary
IdentifiedWithPosition()
          Default constructor
IdentifiedWithPosition(int ident)
          Makes a new Object with the specified id
IdentifiedWithPosition(int ident, int x, int y)
          Make a new identified object with position (x, y)
 
Method Summary
 int id()
          Returns the identifier asociated with this object
 void setId(int iden)
           
 void setPos(int x, int y)
          Sets the new position of the Object, (x, y) both
 void setX(int x)
          Sets the x coordinate of the Object.
 void setY(int y)
          Sets the y coordinate of the Object.
 int x()
          get the X position of the Object
 int y()
          get the Y position of the Object
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

id

protected int id
the integer with wich we're identified :)

x_pos

protected int x_pos
The x cordinate of the Object

y_pos

protected int y_pos
The y cordinate of the Object
Constructor Detail

IdentifiedWithPosition

public IdentifiedWithPosition(int ident,
                              int x,
                              int y)
Make a new identified object with position (x, y)
Parameters:
ident - the identifier of this object

IdentifiedWithPosition

public IdentifiedWithPosition(int ident)
Makes a new Object with the specified id

IdentifiedWithPosition

public IdentifiedWithPosition()
Default constructor
Method Detail

id

public int id()
Returns the identifier asociated with this object
Returns:
the identifier
See Also:
id

setId

public void setId(int iden)

x

public int x()
get the X position of the Object
Returns:
the x position of the Object

y

public int y()
get the Y position of the Object
Returns:
the y position of the Object

setX

public void setX(int x)
Sets the x coordinate of the Object.
Parameters:
x - new x position

setY

public void setY(int y)
Sets the y coordinate of the Object.
Parameters:
y - new y position

setPos

public void setPos(int x,
                   int y)
Sets the new position of the Object, (x, y) both
Parameters:
x - new x coordinate
y - new y coordinate