bike2.BikeProject
Class Axle

java.lang.Object
  extended by 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()
           
 
Method Summary
 void connectToGear(Gear gear)
           
 void connectToWheel(Wheel wheel)
           
 double getAngularVelocity()
           
 void setAngularVelocity(double velocity)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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.

Constructor Detail

Axle

public Axle()
Method Detail

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