1 17 18 package SOFA.SOFAnode.Util.DFSRChecker.parser; 19 20 import java.io.IOException ; 21 22 28 public class StringTokenizer extends ProtocolReader { 29 30 34 public StringTokenizer(String source) { 35 this.source = source; 36 } 37 38 43 public int read() { 44 if (index == source.length()) 45 return -1; 46 else 47 return source.charAt(index++); 48 } 49 50 55 public boolean ready() { 56 return source.length() >= index; 57 } 58 59 63 public int getIndex() { 64 return index; 65 } 66 67 70 public void close() throws IOException { 71 } 73 74 77 public int read(char[] cbuf, int off, int len) throws IOException { 78 throw new IOException ("Not implemented"); 80 } 81 82 85 public void resetIndex() { 86 } 88 90 93 private String source; 94 95 98 int index = 0; 99 100 101 102 } | Popular Tags |