diff options
Diffstat (limited to 'src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java')
-rw-r--r-- | src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java b/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java index b56356d..1fb2709 100644 --- a/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java +++ b/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java @@ -45,16 +45,16 @@ public enum DefaultPrefixRepetitionRule implements Predicate<List<UnitPrefix>> { } else { magnifying = false; } - + // if the first prefix is non-metric (including binary prefixes), // assume we are using non-metric prefixes // non-metric prefixes are allowed, but can't be repeated. if (!Metric.DECIMAL_PREFIXES.contains(prefixes.get(0))) return NO_REPETITION.test(prefixes); - + int part = 0; // 0=yotta/yoctos, 1=kilo-zetta/milli-zepto, // 2=deka,hecto,deci,centi - + for (final UnitPrefix prefix : prefixes) { // check that the current prefix is metric and appropriately // magnifying/reducing @@ -62,7 +62,7 @@ public enum DefaultPrefixRepetitionRule implements Predicate<List<UnitPrefix>> { return false; if (magnifying != prefix.getMultiplier() > 1) return false; - + // check if the current prefix is correct // since part is set *after* this check, part designates the state // of the *previous* prefix @@ -79,7 +79,7 @@ public enum DefaultPrefixRepetitionRule implements Predicate<List<UnitPrefix>> { // deka/hecto must be the last prefix, so this is always invalid return false; } - + // set part if (Metric.YOTTA.equals(prefix) || Metric.YOCTO.equals(prefix)) { part = 0; |