diff options
Diffstat (limited to 'src/main/java/sevenUnitsGUI/UnitConversionView.java')
-rw-r--r-- | src/main/java/sevenUnitsGUI/UnitConversionView.java | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/src/main/java/sevenUnitsGUI/UnitConversionView.java b/src/main/java/sevenUnitsGUI/UnitConversionView.java index 67d3ddc..9d3a67b 100644 --- a/src/main/java/sevenUnitsGUI/UnitConversionView.java +++ b/src/main/java/sevenUnitsGUI/UnitConversionView.java @@ -17,15 +17,8 @@ package sevenUnitsGUI; import java.util.Optional; -import java.util.OptionalDouble; import java.util.Set; -import sevenUnits.unit.BaseDimension; -import sevenUnits.unit.Unit; -import sevenUnits.unit.UnitValue; -import sevenUnits.utils.NamedObjectProduct; -import sevenUnits.utils.ObjectProduct; - /** * A View that supports single unit-based conversion * @@ -37,60 +30,72 @@ public interface UnitConversionView extends View { * @return dimensions available for filtering * @since 2022-01-29 */ - Set<NamedObjectProduct<BaseDimension>> getDimensions(); + Set<String> getDimensionNames(); /** - * @return unit to convert <em>from</em> + * @return name of unit to convert <em>from</em> * @since 2021-12-15 */ - Optional<Unit> getFromSelection(); + Optional<String> getFromSelection(); + + /** + * @return list of names of units available to convert from + * @since 2022-03-30 + */ + Set<String> getFromUnitNames(); /** * @return value to convert between the units (specifically, the numeric * string provided by the user) * @since 2021-12-15 */ - OptionalDouble getInputValue(); + String getInputValue(); /** * @return selected dimension * @since 2021-12-15 */ - Optional<? extends ObjectProduct<BaseDimension>> getSelectedDimension(); + Optional<String> getSelectedDimensionName(); /** - * @return unit to convert <em>to</em> + * @return name of unit to convert <em>to</em> * @since 2021-12-15 */ - Optional<Unit> getToSelection(); + Optional<String> getToSelection(); + + /** + * @return list of names of units available to convert to + * @since 2022-03-30 + */ + Set<String> getToUnitNames(); /** * Sets the available dimensions for filtering. * - * @param dimensions dimensions to use + * @param dimensionNames names of dimensions to use * @since 2021-12-15 */ - void setDimensions(Set<NamedObjectProduct<BaseDimension>> dimensions); + void setDimensionNames(Set<String> dimensionNames); /** * Sets the available units to convert from. {@link #getFromSelection} is not * required to use one of these units; this method is to be used for views * that allow the user to select units from a list. * - * @param units units to convert from + * @param unitNames names of units to convert from * @since 2021-12-15 */ - void setFromUnits(Set<? extends Unit> units); + void setFromUnitNames(Set<String> unitNames); /** * Sets the available units to convert to. {@link #getToSelection} is not * required to use one of these units; this method is to be used for views * that allow the user to select units from a list. * - * @param units units to convert to + * @param unitNames names of units to convert to * @since 2021-12-15 */ - void setToUnits(Set<? extends Unit> units); + void setToUnitNames(Set<String> unitNames); /** * Shows the output of a unit conversion. @@ -99,5 +104,5 @@ public interface UnitConversionView extends View { * @param output output unit & value * @since 2021-12-24 */ - void showUnitConversionOutput(UnitValue input, UnitValue output); + void showUnitConversionOutput(UnitConversionRecord uc); } |