utilities
Class Vector

java.lang.Object
  extended by utilities.Vector

public class Vector
extends 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(Integer dx, Integer dy)
          Creates a new instance of Vector with the given change in X and Y
 
Method Summary
 boolean equals(Object o)
           
 Integer getDx()
          Gets the Integer representing the change in the X direction of this vector
 Integer getDy()
          Gets the Integer representing the change in the Y direction of this vector
 void setDx(Integer dx)
          Sets the change in the X direction of this Vector
 void setDy(Integer dy)
          Sets the change in the Y direction of this Vector
 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(Integer dx,
              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 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 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(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(Integer dy)
Sets the change in the Y direction of this Vector

Parameters:
dy - The new difference in the Y direction

toString

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

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

equals

public boolean equals(Object o)
Overrides:
equals in class Object