diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:40:41 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:40:41 -0400 |
| commit | d4ca769e542b2489b1e23cfcbdc3a0b7275b87cd (patch) | |
| tree | 1653a7399f97fb0c63ce62e3f60fd830d5c37f70 /base/src/main/java/bjc/utils/math/CardinalState.java | |
| parent | 2ac2e31a56ae59ee582e43a90c3495f86dd9ee7a (diff) | |
Cleanup pass
Cleanup pass to uniformize things
Diffstat (limited to 'base/src/main/java/bjc/utils/math/CardinalState.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/math/CardinalState.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/base/src/main/java/bjc/utils/math/CardinalState.java b/base/src/main/java/bjc/utils/math/CardinalState.java index 3c97b68..de2224c 100644 --- a/base/src/main/java/bjc/utils/math/CardinalState.java +++ b/base/src/main/java/bjc/utils/math/CardinalState.java @@ -7,21 +7,21 @@ import java.util.function.LongPredicate; /* * @TODO 2/12/18 Ben Culkin :AdditionalCardinals - * + * * Add some built-in implementations for various things. * * By this, I mean for various unit scales, like custom and metric weights */ /** * Customizations for number cardinalization. - * + * * @author EVE * */ public class CardinalState { /** * Alias type for converting numbers to cardinals. - * + * * @author EVE * */ @@ -44,31 +44,32 @@ public class CardinalState { /** * Create a new set of cardinalization customizations. - * + * * @param customNumbers - * The custom numbers to use. + * The custom numbers to use. * @param customScales - * The custom scales to use. + * The custom scales to use. */ - public CardinalState(Map<Long, String> customNumbers, Map<LongPredicate, Cardinalizer> customScales) { + public CardinalState(Map<Long, String> customNumbers, + Map<LongPredicate, Cardinalizer> customScales) { this.customNumbers = customNumbers; this.customScales = customScales; } /** * Handle a custom cardinal number - * + * * @param number - * The number to handle + * The number to handle * @return The number as a cardinal, or null if we don't handle it. */ public String handleCustom(long number) { - if(customNumbers.containsKey(number)) { + if (customNumbers.containsKey(number)) { return customNumbers.get(number); } - for(Entry<LongPredicate, Cardinalizer> ent : customScales.entrySet()) { - if(ent.getKey().test(number)) { + for (Entry<LongPredicate, Cardinalizer> ent : customScales.entrySet()) { + if (ent.getKey().test(number)) { return ent.getValue().apply(number, this); } } |
