Cosmetic: override in place of switch/case.

This change doesn't add and doesn't break anything, but it's cleaner and makes use of the power of Java enums :)