/** * @since 2020-08-26 */ package org.unitConverter.converterGUI; import java.util.List; import java.util.function.Predicate; import org.unitConverter.unit.UnitPrefix; /** * A rule that specifies whether prefix repetition is allowed * * @since 2020-08-26 */ enum DefaultPrefixRepetitionRule implements Predicate> { NO_REPETITION { @Override public boolean test(List prefixes) { return prefixes.size() <= 1; } }, NO_RESTRICTION { @Override public boolean test(List prefixes) { return true; } }, /** * You are allowed to have any number of Yotta/Yocto followed by possibly one * Kilo-Zetta/Milli-Zepto followed by possibly one Deca/Hecto. Same for * reducing prefixes, don't mix magnifying and reducing. Non-metric * (including binary) prefixes can't be repeated. */ COMPLEX_REPETITION { @Override public boolean test(List prefixes) { // TODO method stub return false; } }; }