home *** CD-ROM | disk | FTP | other *** search
- package com.extensibility.util.regexpr;
-
- class CharPatternInput implements PatternInput {
- protected String text;
- protected int position;
- protected String nextChar;
- protected boolean escaped;
-
- CharPatternInput(String var1) {
- this.text = var1;
- this.position = 0;
- this.figureNextChar();
- }
-
- protected void figureNextChar() {
- this.escaped = false;
- if (this.position < this.text.length()) {
- this.nextChar = this.text.substring(this.position, this.position + 1);
- }
-
- }
-
- public String peekNext() {
- return this.nextChar;
- }
-
- public String next() {
- String var1 = this.nextChar;
- this.position += this.escaped ? 2 : 1;
- this.figureNextChar();
- return var1;
- }
-
- public boolean hasNext() {
- return this.position < this.text.length();
- }
- }
-