utilities
Class Vector

java.lang.Object
  extended by utilities.Vector

public class Vector
extends java.lang.Object

A class that represents a two-dimensional vector. A vector contains two scalars, one contianing an X component and another with a Y component.

Author:
Michael Kozelsky Created on: Jul 28, 2006 Vector.java

Constructor Summary
Vector(java.lang.Integer dx, java.lang.Integer dy)
          Creates a new instance of Vector with the given change in X and Y
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.Integer getDx()
          Gets the Integer representing the change in the X direction of this vector
 java.lang.Integer getDy()
          Gets the Integer representing the change in the Y direction of this vector
 void setDx(java.lang.Integer dx)
          Sets the change in the X direction of this Vector
 void setDy(java.lang.Integer dy)
          Sets the change in the Y direction of this Vector
 java.lang.String toString()
          Returns a String representation of this Vector object
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vector

public Vector(java.lang.Integer dx,
              java.lang.Integer dy)
Creates a new instance of Vector with the given change in X and Y

Parameters:
dx - The difference in the X direction
dy - The difference in the Y direction
Method Detail

getDx

public java.lang.Integer getDx()
Gets the Integer representing the change in the X direction of this vector

Returns:
An Integer representing the change in X

getDy

public java.lang.Integer getDy()
Gets the Integer representing the change in the Y direction of this vector

Returns:
An Integer representing the change in Y

setDx

public void setDx(java.lang.Integer dx)
Sets the change in the X direction of this Vector

Parameters:
dx - The new difference in the X direction

setDy

public void setDy(java.lang.Integer dy)
Sets the change in the Y direction of this Vector

Parameters:
dy - The new difference in the Y direction

toString

public java.lang.String toString()
Returns a String representation of this Vector object

Overrides:
toString in class java.lang.Object
Returns:
This vector as a string
See Also:
Object.toString()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object