be.optiloading
Class Cargo

java.lang.Object
  extended by be.optiloading.Cargo
All Implemented Interfaces:
java.io.Serializable

public class Cargo
extends java.lang.Object
implements java.io.Serializable

Cargo class used to stow information about the cargo

Author:
Tim Pintens, info@optiloading.be, www.optiloading.be
See Also:
Serialized Form

Constructor Summary
Cargo(float w, float s)
          Constructor used to create this object.
 
Method Summary
 float getSpecificgravity()
          Returns the specific gravity of the cargo (density relative to fresh water).
 float getVolume()
          Returns the volume of the cargo in m^3 .
 float getWeight()
          Returns the weight of the cargo in tonnes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cargo

public Cargo(float w,
             float s)
Constructor used to create this object. Responsible for setting the correct weight, volume and specific gravity.

Parameters:
w - A floating point value indicating the weight of the cargo in tonnes.
s - The specific gravity of the cargo.
Method Detail

getWeight

public float getWeight()
Returns the weight of the cargo in tonnes. The weight is set within the constructor.

Returns:
Floating point value that indicates the weight of the cargo in tonnes.

getVolume

public float getVolume()
Returns the volume of the cargo in m^3 . The volume is calculated within the constructor.

Returns:
Floating point value that indicates the volume of the cargo in m^3.

getSpecificgravity

public float getSpecificgravity()
Returns the specific gravity of the cargo (density relative to fresh water). The specific gravity is set within the constructor.

Returns:
Floating point value that indicates the specific gravity of the cargo.