Lighting.java [src/java/m/ahat] Revision: default Date:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package m.ahat;
import database.ahat.AHATcrdb;
/**
*
* @author Brad
*/
class Lighting {
private final AHATcrdb db;
private final int lightingType;
private final boolean longDayLighting;
private double electCost;
public Lighting(AHATcrdb db,int lightingType,boolean ldl){
this.db = db;
this.lightingType = lightingType;
longDayLighting = ldl;
}
public double getElectCost() {
return electCost;
}
public void setElectCost(double electCost) {
this.electCost = electCost;
}
public double getCurrentElectricCost(double kWh){
return kWh * electCost;
}
public double getEstimatedElectricCost(double estimatedkWh) {
return estimatedkWh * electCost;
}
public double getLightingKilowattHours(int house){
double useFactor;
double baseFactor;
useFactor = db.getLightingTypeUseFactor(house, lightingType);
baseFactor = db.getLightingTypeBaseFactor(house, lightingType, longDayLighting);
return baseFactor * useFactor;
}
public double getBetterEstimatedKilowattHours(int house){ // TODO: ask jack about this!
double useFactor;
double baseFactor;
useFactor = db.getLightingTypeBaseFactor(house, lightingType, longDayLighting);
baseFactor = db.getLightingTypeBaseFactor(house, lightingType, longDayLighting);
return baseFactor * Math.pow(useFactor, 2);
}
}