org.zodiac.sdk.json.CharReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zodiac-sdk-json Show documentation
Show all versions of zodiac-sdk-json Show documentation
Zodiac SDK JSON(JavaScript Object Notation)
package org.zodiac.sdk.json;
import org.zodiac.sdk.json.constants.JSONConstants;
public class CharReader {
private String chars;
private int _length;
private int _next = 0;
private char _val;
public CharReader(String s) {
this.chars = s;
this._length = s.length();
}
public boolean read() {
if (_next >= _length) {
return false;
}else {
_val = chars.charAt(_next++);
return true;
}
}
public char next(){
if(read()){
return _val;
}else {
return JSONConstants.EOI;
}
}
public int length(){
return _length;
}
public char value(){
return _val;
}
}