com.timjohnstondev.unitconverter.logic
Class CalculationLogic

java.lang.Object
  extended by com.timjohnstondev.unitconverter.logic.CalculationLogic

public final class CalculationLogic
extends Object

Utility class that contains all of the logic for performing mathematical calculations for the conversions.


Method Summary
static String getConversionFactor(String conversion)
          Returns the formula or formatted numeric conversion factor.
static String getResult(String input, String conversionFactor, BigDecimal molecularWeightCorrection)
          Updates the result field if the input field has valid data and a conversion factor is selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConversionFactor

public static String getConversionFactor(String conversion)
Returns the formula or formatted numeric conversion factor.

Parameters:
conversion - the conversion factor or formula
Returns:
the formula or formatted numeric conversion factor

getResult

public static String getResult(String input,
                               String conversionFactor,
                               BigDecimal molecularWeightCorrection)
Updates the result field if the input field has valid data and a conversion factor is selected.

Parameters:
input - input
conversionFactor - conversionFactor
molecularWeightCorrection - the correction factor to adjust for molecular weight in mole to mass and mass to mole conversions
Returns:
result


Copyright © 2009 Tim Johnston Development, LLC. All Rights Reserved.