Class Lory

java.lang.Object
  extended by Lory
All Implemented Interfaces:
Car

public class Lory
extends java.lang.Object
implements Car

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

Lory

public Lory(java.lang.String type,
            int maxLoad,
            int load)
Constructor for objects of class Lory

Parameters:
type - truck type
maxLoad - the maximum amount of the cargo
load - initial amount of cargo to be loaded. When load > maxLoad then only maxLoad of cargo is loaded.
Method Detail

toString

public java.lang.String toString()
Returns String representation of the particular Lory

Overrides:
toString in class java.lang.Object
Returns:
String representation in the form: " (): tons\t fuel:\n"

unload

public int unload(int load)
Description copied from interface: Car
Unloads the amount of cargo/persons, if available, else fully unloads the car.

Specified by:
unload in interface Car
Parameters:
load - amount of a cargo/persons
Returns:
amount of unloaded cargo/persons

load

public int load(int load)
Description copied from interface: Car
Loads the amount of a cargo/persons

Specified by:
load in interface Car
Parameters:
load - amount of a cargo/persons
Returns:
amount of really loaded cargo/persons

refuel

public void refuel(int fuel)
Description copied from interface: Car
Refuels the car

Specified by:
refuel in interface Car

run

public void run(int distance)
Description copied from interface: Car
Runs the distance suplied as a parameter

Specified by:
run in interface Car
Parameters:
distance - distance to be ran