be.optiloading
Class Tank

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

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

Tank class used to stow information about the tank and calculate its center of gravity.

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

Nested Class Summary
(package private)  class Tank.TankData
           
 
Constructor Summary
Tank(java.lang.String id, float max, float l, int bf, int ef)
          Constructor used to create a new tank.
 
Method Summary
 void addData(float vol, float flo, float kge, float fsmo)
          Method for adding sounding data to the tank.
 int getBeginframe()
          Method to get the begin frame of the tank
 float getCargo()
          Method to get the weight of the cargo in the tank
 int getEndframe()
          Method to get the end frame of the tank
 float getFSM()
          Method to get the Longitudinal Free Surface Moment (FSM) of the tank
 float getKG()
          Method to get the KG of the tank
 float getLCG()
          Method to get the Longitudinal Center of Gravity (LCG) of the tank
 float getLength()
          Method to get the length of the tank
 float getMaxvolume()
          Method to get the maximum volume the tank
 float getSpecificGravity()
          Method to get the specific gravity of the cargo in the tank
 java.lang.String getTankid()
          Method to get the tank's identification
 float getVolume()
          Method to get the volume of the cargo in the tank
 void setVolume(float vol, float specg)
          Method to set the volume of a tank and calculate the longitudinal center of gravity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tank

public Tank(java.lang.String id,
            float max,
            float l,
            int bf,
            int ef)
Constructor used to create a new tank.

Parameters:
id - String to identify the tank.
max - Floating point value indicating the maximum value.
Method Detail

addData

public void addData(float vol,
                    float flo,
                    float kge,
                    float fsmo)
Method for adding sounding data to the tank.

Parameters:
vol - Floating point value indicating a volume.
flo - Floating point value that indicated the longitudinal center of gravity corresponding with the indicated volume.

setVolume

public void setVolume(float vol,
                      float specg)
Method to set the volume of a tank and calculate the longitudinal center of gravity.

Parameters:
vol - Floating point value indicating the volume to be set.
specg - Floating point value indicating the specific gravity of the loaded volume

getLCG

public float getLCG()
Method to get the Longitudinal Center of Gravity (LCG) of the tank

Returns:
Floating point value containing the LCG of the tank

getKG

public float getKG()
Method to get the KG of the tank

Returns:
Floating point value containing the KG of the tank

getFSM

public float getFSM()
Method to get the Longitudinal Free Surface Moment (FSM) of the tank

Returns:
Floating point value containing the FSM of the tank

getCargo

public float getCargo()
Method to get the weight of the cargo in the tank

Returns:
Floating point value containing the weight of the cargo in the tank

getVolume

public float getVolume()
Method to get the volume of the cargo in the tank

Returns:
Floating point value containing the volume of the cargo in the tank

getTankid

public java.lang.String getTankid()
Method to get the tank's identification

Returns:
String value containing the tank's identification

getMaxvolume

public float getMaxvolume()
Method to get the maximum volume the tank

Returns:
Floating point value containing the maximum volume the tank

getLength

public float getLength()
Method to get the length of the tank

Returns:
Floating point value containing the length of the tank

getBeginframe

public int getBeginframe()
Method to get the begin frame of the tank

Returns:
Floating point value containing the begin frame of the tank

getEndframe

public int getEndframe()
Method to get the end frame of the tank

Returns:
Floating point value containing the end frame of the tank

getSpecificGravity

public float getSpecificGravity()
Method to get the specific gravity of the cargo in the tank

Returns:
Floating point value containing the specific gravity of the cargo in the tank