Last active
October 30, 2015 20:58
-
-
Save meatcar/4cc7f631fd3d869f4dab to your computer and use it in GitHub Desktop.
How would you refactor this?
This file contains hidden or 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
| /** | |
| * Get associated terms for this measurement with the given standard deviation value. | |
| * | |
| * @param standardDeviation the measurement's standard deviation value or {@code null} for all associated terms | |
| * @return a list of terms | |
| */ | |
| public Collection<VocabularyTerm> getAssociatedTerms(Double standardDeviation) | |
| { | |
| ResourceBundle configuration = ResourceBundle.getBundle("measurementsAssociatedTerms"); | |
| List<VocabularyTerm> terms = new ArrayList<>(); | |
| if (null == standardDeviation || standardDeviation <= -3) { | |
| addResolvedTermsToList(configuration, this.getName(), "extremeBelowNormal", terms); | |
| } | |
| if (null == standardDeviation || standardDeviation <= -2) { | |
| addResolvedTermsToList(configuration, this.getName(), "belowNormal", terms); | |
| } | |
| if (null == standardDeviation || standardDeviation >= 2) { | |
| addResolvedTermsToList(configuration, this.getName(), "aboveNormal", terms); | |
| } | |
| if (null == standardDeviation || standardDeviation >= 3) { | |
| addResolvedTermsToList(configuration, this.getName(), "extremeAboveNormal", terms); | |
| } | |
| return terms; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment