From 2248b5bcfa3e38fdf65b2f680a7fa44cd39417a9 Mon Sep 17 00:00:00 2001 From: Derek Bankieris Date: Fri, 4 Nov 2016 15:56:51 -0500 Subject: [PATCH] Remove unused variables. Normalize formatting. Refs # 345 --- .../java/src/trick/common/utils/UnitType.java | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/trick_source/java/src/trick/common/utils/UnitType.java b/trick_source/java/src/trick/common/utils/UnitType.java index c331756d..d7a18dce 100644 --- a/trick_source/java/src/trick/common/utils/UnitType.java +++ b/trick_source/java/src/trick/common/utils/UnitType.java @@ -152,18 +152,6 @@ public enum UnitType { }; - public static final String OPERATORS="+-/*()^"; //ignore the "(" as an operator - public static final Map OPERATOR_LEVELS = new HashMap(); - static { - OPERATOR_LEVELS.put(')', 0); - OPERATOR_LEVELS.put('^', 1); - OPERATOR_LEVELS.put('*', 2); - OPERATOR_LEVELS.put('/', 2); - OPERATOR_LEVELS.put('+', 3); - OPERATOR_LEVELS.put('-', 3); - OPERATOR_LEVELS.put('(', 4); - } - /** valid units for this type */ private final ArrayList units; @@ -196,7 +184,7 @@ public enum UnitType { } /** - * Converts the value of a specified units to the preferred units. + * converts the value of a specified units to the preferred units * * @param fromValue from value * @param fromUnitStr from unit @@ -238,8 +226,8 @@ public enum UnitType { } /** - * Returns the primitive unit if it is a primitive units, - * otherwise return a complex units that is made out of primitive units. + * returns the primitive unit if it is a primitive unit. + * Otherwise, returns a complex unit that is made out of primitive units. * * @param expression full expression to parse * @return an instance of {@link Unit} @@ -260,10 +248,10 @@ public enum UnitType { } /** - * Gets the {@link Unit} based on its abbreviation. + * gets the {@link Unit} based on its abbreviation * - * @param abbreviation the units abbreviation. - * @return the corresponding Unit, or null if the abbreviation doesn't exist. + * @param abbreviation the units abbreviation + * @return the corresponding Unit, or null if the abbreviation doesn't exist */ public static Unit getPrimitiveUnit(String abbreviation) { Unit ret = null; @@ -305,7 +293,7 @@ public enum UnitType { * from multiplication, division, or exponentiation. * * @param head the (already processed) head of the units expression - * @param tail the (not yet processed) tai of the units expression + * @param tail the (not yet processed) tail of the units expression * @param results the list to which to append results */ private static void getAll(String head, String tail, List results) { @@ -324,7 +312,7 @@ public enum UnitType { } /** - * Determines if fromUnits can legally be converted to + * determines if fromUnits can legally be converted to * toUnits. This method handles compound units resulting * from multiplication, division, or exponentiation. * @@ -363,7 +351,9 @@ public enum UnitType { this.factor2 = factor2; } - /** constructor + /** + * constructor + * * @param name name of unit * @param abbreviation abbreviation of unit * @param isPrefixable true or false