|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectLory
public class Lory
Write a description of class Lory here.
Constructor Summary | |
---|---|
Lory(java.lang.String type,
int maxLoad,
int load)
Constructor for objects of class Lory |
Method Summary | |
---|---|
int |
load(int load)
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 Lory |
int |
unload(int load)
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 Lory(java.lang.String type, int maxLoad, int load)
type
- truck typemaxLoad
- the maximum amount of the cargoload
- initial amount of cargo to be loaded. When load > maxLoad
then only maxLoad of cargo is loaded.Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public int unload(int load)
Car
unload
in interface Car
load
- amount of a cargo/persons
public int load(int load)
Car
load
in interface Car
load
- 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 |