org.mars_sim.msp.simulation.structure.goods
Class GoodsUtil

java.lang.Object
  extended by org.mars_sim.msp.simulation.structure.goods.GoodsUtil

public class GoodsUtil
extends java.lang.Object

Utility class for goods information.


Method Summary
static boolean containsGood(Good good)
          Checks if a good is valid in the simulation.
static Good getEquipmentGood(java.lang.Class equipmentClass)
          Gets a good object for a given equipment class.
static double getGoodMassPerItem(Good good)
          Gets the mass per item for a good.
static java.util.List<Good> getGoodsList()
          Gets a list of all goods in the simulation.
static Good getResourceGood(Resource resource)
          Gets a good object for a given resource.
static Good getVehicleGood(java.lang.String vehicleType)
          Gets a good object for the given vehicle type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getGoodsList

public static java.util.List<Good> getGoodsList()
Gets a list of all goods in the simulation.

Returns:
list of goods

getResourceGood

public static Good getResourceGood(Resource resource)
Gets a good object for a given resource.

Parameters:
resource - the resource.
Returns:
good for the resource.

getEquipmentGood

public static Good getEquipmentGood(java.lang.Class equipmentClass)
Gets a good object for a given equipment class.

Parameters:
equipmentClass - the equipment class.
Returns:
good for the resource class or null if none.

getVehicleGood

public static Good getVehicleGood(java.lang.String vehicleType)
Gets a good object for the given vehicle type.

Parameters:
vehicleType - the vehicle type string.
Returns:
good for the vehicle type.

containsGood

public static boolean containsGood(Good good)
Checks if a good is valid in the simulation.

Parameters:
good - the good to check.
Returns:
true if good is valid.

getGoodMassPerItem

public static double getGoodMassPerItem(Good good)
                                 throws java.lang.Exception
Gets the mass per item for a good.

Parameters:
good - the good to check.
Returns:
mass (kg) per item (or 1kg for amount resources).
Throws:
java.lang.Exception - if error getting mass per item.