change string switch to ifs to compile with java 6.