bike2.BikeProject
Class Axle
java.lang.Object
bike2.BikeProject.Axle
public class Axle
- extends java.lang.Object
Models the axle of a bike.
- Author:
- Tom James
|
Field Summary |
private double |
angularVelocity
The angular velocity of the axle. |
private Gear |
gear
The gear to which the axle is attached. |
private Wheel |
wheel
The wheel to which the axle is attached. |
|
Constructor Summary |
Axle()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
angularVelocity
private double angularVelocity
- The angular velocity of the axle.
gear
private Gear gear
- The gear to which the axle is attached.
wheel
private Wheel wheel
- The wheel to which the axle is attached.
Axle
public Axle()
connectToWheel
public void connectToWheel(Wheel wheel)
- Parameters:
wheel - The wheel that will be connected to the axle.
connectToGear
public void connectToGear(Gear gear)
- Parameters:
gear - The gear that will be connected to the axle.
setAngularVelocity
public void setAngularVelocity(double velocity)
- Parameters:
velocity - The angular velocity to which the axle will be set.
getAngularVelocity
public double getAngularVelocity()
- Returns:
- The angular velocity of the axle.
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object