diff --git a/app/src/main/java/com/sf/stormwaterutilityandroid/WaterWay/PTI.java b/app/src/main/java/com/sf/stormwaterutilityandroid/WaterWay/PTI.java new file mode 100644 index 0000000..9a4c346 --- /dev/null +++ b/app/src/main/java/com/sf/stormwaterutilityandroid/WaterWay/PTI.java @@ -0,0 +1,39 @@ +package com.sf.stormwaterutilityandroid.WaterWay; + +public class PTI { + private double BM_intolerant = 0; + private double BM_moderately_tolerant = 0; + private double BM_fairly_tolerant = 0; + private double BM_very_tolerant = 0; + + PTI(double BM_intolerant, double BM_moderately_tolerant, double BM_fairly_tolerant, double BM_very_tolerant) { + this.BM_intolerant = BM_intolerant; + this.BM_moderately_tolerant = BM_moderately_tolerant; + this.BM_fairly_tolerant = BM_fairly_tolerant; + this.BM_very_tolerant = BM_very_tolerant; + } + + public void setBM_intolerant(double value) { + BM_intolerant = value; + } + + public void setBM_moderately_tolerant(double value) { + BM_moderately_tolerant = value; + } + + public void setBM_fairly_tolerant(double value) { + BM_fairly_tolerant = value; + } + + public void setBM_very_tolerant(double value) { + BM_very_tolerant = value; + } + + public double calculatePTI() { + return 4.0 * BM_intolerant + 3.0 * BM_moderately_tolerant + 2.0 * BM_fairly_tolerant + 1.0 * BM_very_tolerant; + } + + public static double getPTI(double intolerant, double moderate, double fairly, double very) { + return 4.0 * intolerant + 3.0 * moderate + 2.0 * fairly + 1.0 * very; + } +}