Class Utility

java.lang.Object
  |
  +--Utility

public class Utility
extends java.lang.Object

Represents a utility that provides energy.


Field Summary
static int ELECTRICITY
           
static int GAS
           
 
Constructor Summary
Utility(int type, double rate, java.lang.String name)
          Creates an instance of the Utility class.
 
Method Summary
 double getCO2(double kwh)
          Returns the amount of CO2 (in Kg) emitted for this Utility, given an amount of delivered energy, in kwh.
 double getCost(double kwh)
          Returns the cost (in dollars) of energy used, given type of energy, and amount used, in Kwh.
 double getNOX(double kwh)
           
 double getRate(int type)
          Return utility cost in dollars per Kwh.
 double getSO2(double kwh)
           
 int getType()
          Return the type of energy (eg Utility.ELECTRICITY or Utility.GAS) provided by this utility.
 double getVOC(double kwh)
           
 void setRate(int type, double val)
          Set the utility rate for this utility.
 void setType(int type)
          Set th type of energy (eg Utility.ELECTRICITY or Utility.GAS) provided by this utility.
 void setUtilityCO2(double val)
          Sets the amount of CO2 (in Kg) emitted per Kwh for this Utility.
 void setUtilityNOX(double val)
           
 void setUtilitySO2(double val)
           
 void setUtilityVOC(double val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GAS

public static final int GAS

ELECTRICITY

public static final int ELECTRICITY
Constructor Detail

Utility

public Utility(int type,
               double rate,
               java.lang.String name)

Creates an instance of the Utility class.

Method Detail

getType

public int getType()
Return the type of energy (eg Utility.ELECTRICITY or Utility.GAS) provided by this utility.

setType

public void setType(int type)
Set th type of energy (eg Utility.ELECTRICITY or Utility.GAS) provided by this utility.

getRate

public double getRate(int type)
Return utility cost in dollars per Kwh.

setRate

public void setRate(int type,
                    double val)
Set the utility rate for this utility.

getCost

public double getCost(double kwh)
Returns the cost (in dollars) of energy used, given type of energy, and amount used, in Kwh.

getCO2

public double getCO2(double kwh)
Returns the amount of CO2 (in Kg) emitted for this Utility, given an amount of delivered energy, in kwh.

setUtilityCO2

public void setUtilityCO2(double val)
Sets the amount of CO2 (in Kg) emitted per Kwh for this Utility.

getNOX

public double getNOX(double kwh)

setUtilityNOX

public void setUtilityNOX(double val)

getSO2

public double getSO2(double kwh)

setUtilitySO2

public void setUtilitySO2(double val)

getVOC

public double getVOC(double kwh)

setUtilityVOC

public void setUtilityVOC(double val)