Etch-a-sketch Problem Set Javadocs

etchasketch
Class Impact

java.lang.Object
  extended byetchasketch.Impact

public class Impact
extends java.lang.Object

An immutable object desrcribing an impact with a Barrier (Future use).

Version:
$Id: Impact.java,v 1.2 2004/03/26 21:10:50 gus Exp $
Author:
Patrick G. Heck, gus.heck@olin.edu

Constructor Summary
Impact(DotPoint start, DotPoint attempt, DotPoint impact, DotPoint result, double velX, double velY)
          Creates a new instance of Impact.
 
Method Summary
 DotPoint getAttemptPoint()
          The point we tried to reach that caused an impact.
 DotPoint getImpactPoint()
          Findout where the impact occured.
 double getNewVelX()
          Find out what our x velocity is after the impact.
 double getNewVelY()
          Find out what our new Y velocity is.
 DotPoint getResultPoint()
          Find out where we wound up after the impact.
 DotPoint getStartPoint()
          Find out where we started from before the impact occured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Impact

public Impact(DotPoint start,
              DotPoint attempt,
              DotPoint impact,
              DotPoint result,
              double velX,
              double velY)
Creates a new instance of Impact. This class is immutable by design, because it makes absolutely no sense for an impact to change after it has happened. This also allows us to pass it arround without any worries at all about thread safety.

Parameters:
start - The point we started from before the impact occured
attempt - The point we were attempting to reach when the impact occured
impact - The point at which the impact occured
result - The point where we wound up after the impact
velX - the new x velocity after the impact
velY - the new y velocity after the impact
Method Detail

getStartPoint

public DotPoint getStartPoint()
Find out where we started from before the impact occured.

Returns:
The point where we started

getAttemptPoint

public DotPoint getAttemptPoint()
The point we tried to reach that caused an impact.

Returns:
Our intended destination

getResultPoint

public DotPoint getResultPoint()
Find out where we wound up after the impact.

Returns:
Where we wound up

getImpactPoint

public DotPoint getImpactPoint()
Findout where the impact occured.

Returns:
The point of impact.

getNewVelX

public double getNewVelX()
Find out what our x velocity is after the impact.

Returns:
Our new X velocity

getNewVelY

public double getNewVelY()
Find out what our new Y velocity is.

Returns:
Our new Y velocity

Etch-a-sketch Problem Set Javadocs