nl.bluering.ppracing
Class Vector

java.lang.Object
  |
  +--nl.bluering.ppracing.Vector

public class Vector
extends java.lang.Object

Dataclass for saving the car-movements


Constructor Summary
Vector(int x, int y)
          Constructs a new Vector
 
Method Summary
 int getx()
           
 int gety()
           
 double length()
           
 int setx(int x)
           
 int sety(int y)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vector

public Vector(int x,
              int y)
Constructs a new Vector
Parameters:
x - Horizontal speed
y - Vertical speed
Method Detail

length

public double length()
Returns:
The mathematical length of this Vector

getx

public int getx()
Returns:
The horizontal speed

gety

public int gety()
Returns:
The vertical speed

setx

public int setx(int x)
Parameters:
x - Horizontal speed to set
Returns:
the new set horizontal speed

sety

public int sety(int y)
Parameters:
x - Vertical speed to set
Returns:
the new set vertical speed

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
A String representation of this Vector