All Packages Class Hierarchy This Package Previous Next Index
Class cs101.canvas.Position
java.lang.Object
|
+----cs101.canvas.Position
- public class Position
- extends Object
Class to represent a point in two dimensional coordinate space
-
x
- x coordinate of point
-
y
- y coordinate of point
-
Position()
- Constructs a Position with the
x and y coordinates equal to zero
-
Position(int, int)
- Constructs a Position with the passed coordinates
-
copyPosition(Position)
- Copyies the passed Position to the current Position
-
setPosition(int, int)
- Sets the Position to a new x and y coordinate
-
toString()
- Formats the Position to output a string in
the form (x,y)
x
public int x
- x coordinate of point
y
public int y
- y coordinate of point
Position
public Position()
- Constructs a Position with the
x and y coordinates equal to zero
- Returns:
- none
Position
public Position(int x,
int y)
- Constructs a Position with the passed coordinates
- Parameters:
- x - x coordinate of point
- y - y coordinate of point
- Returns:
- none
setPosition
public synchronized void setPosition(int x,
int y)
- Sets the Position to a new x and y coordinate
- Parameters:
- x - new x coordinate
- y - new y coordinate
- Returns:
- none
copyPosition
public synchronized void copyPosition(Position point)
- Copyies the passed Position to the current Position
- Parameters:
- point - Position of point to be copied from
- Returns:
- none
toString
public String toString()
- Formats the Position to output a string in
the form (x,y)
- Returns:
- string format
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index