diff options
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); } } |
