Index

C F G P R S T 
All Classes and Interfaces|All Packages|Constant Field Values

C

car - package car
 
Car - Class in car
Class invariants: The gas tank does not contain a negative amount of gas.
Car() - Constructor for class car.Car
Create a car that gets 20 mpg and has a tank capacity of 10 gallons
compareTo(Car) - Method in class car.Car
compare this car with otherCar to see which one is ahead (i.e.

F

fillTank() - Method in class car.Car
Fills the tank to the full capacity.
FORWARD - Static variable in class car.Car
 

G

getCapacity() - Method in class car.Car
Returns the car's fuel tank capacity
getGear() - Method in class car.Car
Returns the car's current gear
getLocation() - Method in class car.Car
Returns the car's current location
getMPG() - Method in class car.Car
Returns the car's miles per gallon
getRemainingGas() - Method in class car.Car
Returns car's current amount of gas
go(double) - Method in class car.Car
Go for a specified distance (or as far as the current gas allows) in the current gear

P

PARK - Static variable in class car.Car
 

R

refuel(double) - Method in class car.Car
Fills the gas tank with the given amount of gas, or enough to fill the tank, whichever is less.
REVERSE - Static variable in class car.Car
 

S

setGear(int) - Method in class car.Car
Sets the gear that the car will be in.

T

toString() - Method in class car.Car
Used in printing the car's status.
C F G P R S T 
All Classes and Interfaces|All Packages|Constant Field Values