public static double convert ( TemperatureScale from , TemperatureScale to , double temperature ) { switch ( from ) { case FARENHEIT : return convertFromFarenheit ( to , temperature ) ; case CELSIUS : return convertFromCelsius ( to , temperature ) ; case KELVIN : return convertFromKelvin ( to , temperature ) ; case RANKINE : return convertFromRankine ( to , temperature ) ; default : throw ( new RuntimeException ( "Invalid termpature conversion" ) ) ; } }
Convert a temperature value from one temperature scale to another .