import java.util.*; public class Acceleration { private double massValue; private Map.Entry<Double, Double> forceValue; private Velocity velocity; private Onground onground; private Map.Entry<Double, Double> value; public void updateByMass(double mass) { this.massValue = mass; Map.Entry<Double, Double> temp_l0; if (this.onground.getOnground()) { temp_l0 = new AbstractMap.SimpleEntry<>((forceValue.getKey() / mass), 0.0); } else { temp_l0 = new AbstractMap.SimpleEntry<>((forceValue.getKey() / mass), (forceValue.getValue() / mass)); } value = temp_l0; velocity.updateByAcceleration(value); } public void updateByForce(Map.Entry<Double, Double> force) { this.forceValue = force; Map.Entry<Double, Double> temp_l1; if (this.onground.getOnground()) { temp_l1 = new AbstractMap.SimpleEntry<>((force.getKey() / massValue), 0.0); } else { temp_l1 = new AbstractMap.SimpleEntry<>((force.getKey() / massValue), (force.getValue() / massValue)); } value = temp_l1; velocity.updateByAcceleration(value); } public Acceleration(Velocity velocity, Onground onground) { this.onground = onground; } public Map.Entry<Double, Double> getValue() { return value; } }