|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPersonalCar
public class PersonalCar
Write a description of class PersonalCar here.
Constructor Summary | |
---|---|
PersonalCar(java.lang.String type,
int maxPersons,
int persons)
Constructor for objects of class PersonalCar |
Method Summary | |
---|---|
int |
load(int cargo)
Loads the amount of a cargo/persons |
void |
refuel(int fuel)
Refuels the car |
void |
run(int distance)
Runs the distance suplied as a parameter |
java.lang.String |
toString()
Returns String representation of the particular object. |
int |
unload(int cargo)
Unloads the amount of cargo/persons, if available, else fully unloads the car. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PersonalCar(java.lang.String type, int maxPersons, int persons)
type
- car typemaxPersons
- maximum number of allowed personspersons
- persons to be initiali loaded. When persons > maxPersons only
maxPersons will be loaded.Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public int unload(int cargo)
Car
unload
in interface Car
cargo
- amount of a cargo/persons
public int load(int cargo)
Car
load
in interface Car
cargo
- amount of a cargo/persons
public void refuel(int fuel)
Car
refuel
in interface Car
public void run(int distance)
Car
run
in interface Car
distance
- distance to be ran
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |