< prev index next >
core/JemmyCore/src/org/jemmy/Vector.java
Print this page
@@ -32,102 +32,63 @@
public class Vector {
private double x;
private double y;
- /**
- *
- * @param x
- * @param y
- */
public Vector(double x, double y) {
this.x = x;
this.y = y;
}
- /**
- *
- * @param from
- * @param to
- */
public Vector(Point from, Point to) {
x = to.x - from.x;
y = to.y - from.y;
}
- /**
- *
- * @return
- */
public double getX() {
return x;
}
- /**
- *
- * @return
- */
public double getY() {
return y;
}
- /**
- *
- * @return
- */
public double lenght() {
return Math.sqrt(x*x + y*y);
}
- /**
- *
- * @param newLenght
- * @return self
- */
public Vector setLenght(double newLenght) {
double lenght = lenght();
x = x * newLenght / lenght;
y = y * newLenght / lenght;
return this;
}
- /**
- * @param multiplier
- * @return self
- */
public Vector multiply(double multiplier) {
x*=multiplier;
y*=multiplier;
return this;
}
/**
- *
- * @return a clone
+ * {@inheritDoc}
*/
@Override
public Vector clone() {
return new Vector(x, y);
}
/**
- *
- * @return
+ * {@inheritDoc}
*/
@Override
public String toString() {
return "(" + x + "," + y + ")";
}
- /**
- * Adds another vector <code>(x1 + x2, y1 + y2)</code>
- * @param v
- * @return self
- */
public Vector add(Vector v) {
x+=v.x;
y+=v.y;
return this;
}
-
}
< prev index next >