Use a constant-valued switch statement instead of instance variables so the JIT compiler can optimize more