public class Gear
extends java.lang.Object
| Constructor and Description |
|---|
Gear() |
| Modifier and Type | Method and Description |
|---|---|
float |
getMaxKph()
Determine the tread speed that triggers an automatic upshift.
|
float |
getMinKph()
Determine the tread speed that triggers an automatic downshift.
|
float |
getRedlineKph()
Determine the tread speed at the redline.
|
float |
inverseRatio(Vehicle vehicle)
Determine the inverse speed ratio, defined as axle (output) angular rate
divided by crankshaft (input) angular rate: negative for reverse, 0 for
neutral, positive for a forward gear, and >1 for overdrive
|
boolean |
isForward()
Test whether this is a forward gear.
|
boolean |
isNeutral()
Test whether this is neutral gear.
|
boolean |
isReverse()
Test whether this is a reverse gear.
|
java.lang.String |
name()
Determine the name of this gear.
|
void |
setMaxKph(float upshiftKph)
Alter the tread speed that triggers an automatic upshift.
|
void |
setMinKph(float downshiftKph)
Alter the tread speed that triggers an automatic downshift.
|
void |
setMinMaxRedKph(float downshiftKph,
float upshiftKph,
float redlineKph)
Convenience method to configure the speed range and ratio.
|
Gear |
setName(java.lang.String newName)
Alter the name of this Gear.
|
void |
setRedlineKph(float redlineKph)
Alter the tread speed at the redline.
|
public float getMaxKph()
public float getMinKph()
public float getRedlineKph()
public float inverseRatio(Vehicle vehicle)
vehicle - the Vehicle containing this Gear (not null, unaffected)public boolean isForward()
public boolean isNeutral()
public boolean isReverse()
public java.lang.String name()
public void setMaxKph(float upshiftKph)
upshiftKph - the desired signed speed (in kilometers per hour)public void setMinKph(float downshiftKph)
downshiftKph - the desired signed speed (in kilometers per hour)public Gear setName(java.lang.String newName)
newName - the desired name (not null, not empty)public void setMinMaxRedKph(float downshiftKph,
float upshiftKph,
float redlineKph)
downshiftKph - the desired signed speed for downshift (in kilometers
per hour)upshiftKph - the desired signed speed for upshift (in kilometers per
hour)redlineKph - the desired signed tread speed at the redline (in
kilometers per hour)public void setRedlineKph(float redlineKph)
redlineKph - the desired signed speed (in kilometers per hour)