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