Class SimpleCharStream
- java.lang.Object
-
- com.yahoo.prelude.semantics.parser.AbstractCharStream
-
- com.yahoo.prelude.semantics.parser.SimpleCharStream
-
- All Implemented Interfaces:
CharStream
public class SimpleCharStream extends AbstractCharStream
An implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (without unicode processing).
-
-
Field Summary
Fields Modifier and Type Field Description protected Reader
inputStream
-
Fields inherited from class com.yahoo.prelude.semantics.parser.AbstractCharStream
available, bufcolumn, buffer, bufline, bufpos, bufsize, column, DEFAULT_BUF_SIZE, inBuf, line, maxNextCharInd, nextCharBuf, nextCharInd, prevCharIsCR, prevCharIsLF, tokenBegin
-
-
Constructor Summary
Constructors Constructor Description SimpleCharStream(InputStream dstream, String encoding)
Constructor.SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn)
Constructor.SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)
Constructor.SimpleCharStream(Reader dstream)
Constructor.SimpleCharStream(Reader dstream, int startline, int startcolumn)
Constructor.SimpleCharStream(Reader dstream, int startline, int startcolumn, int buffersize)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
fillBuff()
char
readChar()
Read a character.void
reInit(InputStream dstream, String encoding)
Reinitialise.void
reInit(InputStream dstream, String encoding, int startline, int startcolumn)
Reinitialise.void
reInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize)
Reinitialise.void
reInit(Reader dstream)
Reinitialise.void
reInit(Reader dstream, int startline, int startcolumn)
Reinitialise.void
reInit(Reader dstream, int startline, int startcolumn, int buffersize)
Reinitialise.protected void
streamClose()
protected int
streamRead(char[] buffer, int offset, int len)
-
Methods inherited from class com.yahoo.prelude.semantics.parser.AbstractCharStream
adjustBeginLineColumn, backup, beginToken, done, expandBuff, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getImage, getSuffix, getTabSize, isTrackLineColumn, reInit, setTabSize, setTrackLineColumn, updateLineColumn
-
-
-
-
Field Detail
-
inputStream
protected Reader inputStream
-
-
Constructor Detail
-
SimpleCharStream
public SimpleCharStream(Reader dstream, int startline, int startcolumn, int buffersize)
Constructor.
-
SimpleCharStream
public SimpleCharStream(Reader dstream, int startline, int startcolumn)
Constructor.
-
SimpleCharStream
public SimpleCharStream(Reader dstream)
Constructor.
-
SimpleCharStream
public SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException
Constructor.- Throws:
UnsupportedEncodingException
-
SimpleCharStream
public SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException
Constructor.- Throws:
UnsupportedEncodingException
-
SimpleCharStream
public SimpleCharStream(InputStream dstream, String encoding) throws UnsupportedEncodingException
Constructor.- Throws:
UnsupportedEncodingException
-
-
Method Detail
-
streamRead
protected int streamRead(char[] buffer, int offset, int len) throws IOException
- Specified by:
streamRead
in classAbstractCharStream
- Throws:
IOException
-
streamClose
protected void streamClose() throws IOException
- Specified by:
streamClose
in classAbstractCharStream
- Throws:
IOException
-
fillBuff
protected void fillBuff() throws IOException
- Overrides:
fillBuff
in classAbstractCharStream
- Throws:
IOException
-
readChar
public char readChar() throws IOException
Read a character.- Specified by:
readChar
in interfaceCharStream
- Overrides:
readChar
in classAbstractCharStream
- Returns:
- the next character from the selected input
- Throws:
IOException
- on IO error
-
reInit
public void reInit(Reader dstream)
Reinitialise.
-
reInit
public void reInit(Reader dstream, int startline, int startcolumn)
Reinitialise.
-
reInit
public void reInit(Reader dstream, int startline, int startcolumn, int buffersize)
Reinitialise.
-
reInit
public void reInit(InputStream dstream, String encoding) throws UnsupportedEncodingException
Reinitialise.- Throws:
UnsupportedEncodingException
-
reInit
public void reInit(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException
Reinitialise.- Throws:
UnsupportedEncodingException
-
reInit
public void reInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException
Reinitialise.- Throws:
UnsupportedEncodingException
-
-