diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2020-09-10 17:12:59 -0300 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2020-09-10 17:12:59 -0300 |
| commit | 229054f4839ad99c8c9fc757cce7edc0d2ca3cf1 (patch) | |
| tree | f9de568967b82c46f6d22eda9c843529b6045b5d /src/main/java/bjc/inflexion/CardinalState.java | |
| parent | cb45132debdbce593a235323e9155b5c47906558 (diff) | |
| parent | e71ef0d03e87df19900db8328cda68d38d523b0b (diff) | |
Merge branch 'master' of https://github.com/bculkin2442/Inflexion
Diffstat (limited to 'src/main/java/bjc/inflexion/CardinalState.java')
| -rw-r--r-- | src/main/java/bjc/inflexion/CardinalState.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/main/java/bjc/inflexion/CardinalState.java b/src/main/java/bjc/inflexion/CardinalState.java index b9867f7..fe42b41 100644 --- a/src/main/java/bjc/inflexion/CardinalState.java +++ b/src/main/java/bjc/inflexion/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); } } |
