/** * @author Gaspar Guerra * CurrentState.java * Project Assignment5 */ public class CurrentState { private double x; //Position in X private double y; //Position in Y private double vx; //Velocity, horizontal component private double vy; //Velocity, vertical component public CurrentState( double nx, double ny, double nvx, double nvy ){ //Initialize Variables with values given x = nx; y = ny; vx = nvx; vy = nvy; } /* * The following four methods return each of the variables */ public double getX( ){ return x; } public double getY( ){ return y; } public double getVX( ){ return vx; } public double getVY( ){ return vy; } /* * The following methods modify the variables */ public void setX( double newX ){ x = newX; } public void setY( double newY ){ y = newY; } public void setVX( double newV ){ vx = newV; } public void setVY( double newV ){ vy = newV; } /* * Return a String representation of this object */ public String toString( ){ return "X = " + x + "\nY = " + y + "\nVX = " + vx + "\nVY = " + vy; } }