-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/sf/stormwaterutilityandroid/WaterWay/PTI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |