bike2.BikeProject
Class Gear

java.lang.Object
  extended by bike2.BikeProject.Gear

public class Gear
extends java.lang.Object

Models the gear of a bike.

Author:
Tom James

Field Summary
private  double angularVelocity
          The angular velocity of the gear.
private  Axle axle
          The axle to which the gear will be attached.
private  Chain chain
          The chain to which the gear will be attached.
private  double radius
          The radius of the gear.
private  double rollingVelocity
          The rolling velocity of the gear.
 
Constructor Summary
Gear()
           
 
Method Summary
 void connectToAxle(Axle axle)
           
 void connectToChain(Chain chain)
           
 double getAngularVelocity()
           
 double getRadius()
           
 double getRollingVelocity()
           
 void setAngularVelocity(double velocity)
           
 void setRadius(double radius)
           
 void setRollingVelocity(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

radius

private double radius
The radius of the gear.


angularVelocity

private double angularVelocity
The angular velocity of the gear.


rollingVelocity

private double rollingVelocity
The rolling velocity of the gear.


chain

private Chain chain
The chain to which the gear will be attached.


axle

private Axle axle
The axle to which the gear will be attached.

Constructor Detail

Gear

public Gear()
Method Detail

connectToChain

public void connectToChain(Chain chain)
Parameters:
chain - The chain to which the gear will be attached.

connectToAxle

public void connectToAxle(Axle axle)
Parameters:
axle - The axle to which the gear will be attached.

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 gear.

setRadius

public void setRadius(double radius)
Parameters:
radius - The radius of the gear.

getRadius

public double getRadius()
Returns:
The radius of the gear.

setRollingVelocity

public void setRollingVelocity(double velocity)
Parameters:
velocity - The rolling velocity to which the gear will be set.

getRollingVelocity

public double getRollingVelocity()
Returns:
The rolling velocity of the gear.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object