int x = Integer.parseInt(text.split(" ")[1]); int y = Integer.parseInt(text.split(" ")[3]); String shift = text.split(" ")[2]; int shifted = -1; if(shift.equals("<<")) { shifted = x << y; } else if(shift.equals(">>")) { shifted = x >> y; } else { return; } if(shifted > -1) { output.send("PRIVMSG " + channel + " :" + x + " " + shift + " " + y + " = " + shifted); }