import java.awt.Color; /**Parent class for all stationary objects. It inherits the properties of BoxedBallsObject. * All stationary objects have a velocity=0, and their mass, for the purpose of momentum calculations, is effectively infinity*/ public class StationaryObject extends BoxedBallsObject { /**1.0/0.0 produces infinity*/ public static final double STATIONARY_OBJECT_MASS = 1.0/0.0; public static final double STATIONARY_OBJECT_VELOCITY = 0.0; private double mass; private double xVelocity; private double yVelocity; public StationaryObject() { super(); mass = STATIONARY_OBJECT_MASS; xVelocity = STATIONARY_OBJECT_VELOCITY; yVelocity = STATIONARY_OBJECT_VELOCITY; } public StationaryObject(String s, Color c) { super(s, c); mass = STATIONARY_OBJECT_MASS; xVelocity = STATIONARY_OBJECT_VELOCITY; yVelocity = STATIONARY_OBJECT_VELOCITY; } public double getMass() { return mass; } public double getXVelocity() { return xVelocity; } public double getYVelocity() { return yVelocity; } public Color getColor() { return super.getColor(); } }