1 package com.quantum.sql.parser;
3 public class StringPointer {
7 public StringPointer(String s) {
8 value = s.toCharArray();
11 * Returns the next character. Will return 0 if at end of file, but that's not
12 * checkeable because it can be a valid character. You should check with isDone();
15 public char getNext() {
16 char retVal = (offset < value.length) ? value[offset] : 0;
21 * Returns the next character, without advancing the pointer.
22 * Will return 0 if at end of file, but that's not
23 * checkeable because it can be a valid character. You should check with isDone();
27 char retVal = (offset < value.length) ? value[offset] : 0;
31 * Marks a poing of the stream to come back later (using reset());
37 * Returns to a previously marked (with mark()) place.
43 * Sets the pointer back a character, in fact 'pop'ing it back to the stream;
46 if (offset > 0) offset--;
49 public int getOffset() {
53 * @return true if the stream is at an end
55 public boolean isDone() {
56 return offset >= value.length;
59 public int getLength() {