@@ -0,0 +1,1302 @@
+package codeu.chat.util;%0Aimport java.io.IOException;%0A%0Apublic final class Tokenizer %7B%0A%09private StringBuilder token;%0A%09private String source;%0A%09private int at;%0A%0A%09public Tokenizer(String source) %7B%0A%09%09this.source = source;%0A%09%7D%0A%09public String next() throws IOException %7B%0A%09%09while (remaining() %3E 0 && Character.isWhitespace(peek())) %7B%0A%09%09%09read();%0A%09%09%7D if (remaining() %3C= 0) %7B%0A%09%09%09return null;%0A%09%09%7D else if (peek() == '%22') %7B%0A%09%09%09readWithQuotes();%0A%09%09%7D else %7B%0A%09%09%09readWithNoQuotes();%0A%09%09%7D%0A%09%09return %22%22;%0A%09%7D%0A%0A%09private int remaining() %7B%0A%09%09return source.length() - at;%0A%09%7D%0A%0A%09private char peek() throws IOException %7B%0A%09%09if (at %3C source.length()) %7B%0A%09%09%09return source.charAt(at);%0A%09%09%7D else %7B%0A%09%09%09throw new IOException(%22Cannot see character past the source length%22);%0A%09%09%7D%0A%09%7D%0A%0A%09private char read() throws IOException %7B%0A%09%09final char c = peek();%0A%09%09at += 1;%0A%09%09return c;%0A%09%7D%0A%0A%09private String readWithNoQuotes() throws IOException %7B%0A%09%09token.setLength(0);%0A%09%09while (remaining() %3E 0 && !Character.isWhitespace(peek())) %7B%0A%09%09%09token.append(read());%0A%09%09%7D%0A%09%09return token.toString();%0A%09%7D%0A%0A%09private String readWithQuotes() throws IOException %7B%0A%09%09token.setLength(0);%0A%09%09if (read() != '%22') %7B%0A%09%09%09throw new IOException(%22Strings must start with opening quote%22);%0A%09%09%7D%0A%09%09while (peek() != '%22') %7B%0A%09%09%09token.append(read());%0A%09%09%7D%0A%09%09read();%0A%09%09return token.toString();%0A%09%7D%0A%7D%0A

Create Tokenizer.java