Given this method, does this represent some egregious stylistic or semantic faux pas:
private double translateSlider(int sliderVal) {
switch (sliderVal) {
From human intelligence view your code is fine. From static code analysis tools view there are multiple returns, which makes it harder to debug. e.g you cannot set one and only breakpoint immediately before return.
Further you would not hard code the 4 slider steps in an professional app. Either calculate the values by using max - min, etc., or look them up in an array:
public static final double[] SLIDER_VALUES = {1.0, 0.9, 0.8, 0.7, 0.6};
public static final double SLIDER_DEFAULT = 1.0;
private double translateSlider(int sliderValue) {
double result = SLIDER_DEFAULT;
if (sliderValue >= 0 && sliderValue < SLIDER_VALUES.length) {
ret = SLIDER_VALUES[sliderValue];
}
return result;
}