Package com.github.javaparser
Class SimpleCharStream
- java.lang.Object
-
- com.github.javaparser.AbstractCharStream
-
- com.github.javaparser.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 inherited from class com.github.javaparser.AbstractCharStream
available, buffer, bufpos, bufsize, DEFAULT_BUF_SIZE, inBuf, maxNextCharInd, tokenBegin
-
-
Constructor Summary
Constructors Constructor Description SimpleCharStream(Provider dstream)
Constructor.SimpleCharStream(Provider dstream, int startline, int startcolumn)
Constructor.SimpleCharStream(Provider dstream, int startline, int startcolumn, int buffersize)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
reInit(Provider dstream)
Reinitialise.void
reInit(Provider dstream, int startline, int startcolumn)
Reinitialise.void
reInit(Provider dstream, int startline, int startcolumn, int buffersize)
Reinitialise.protected void
streamClose()
Close the underlying stream.protected int
streamRead(char[] aBuf, int nOfs, int nLen)
Read from the underlying stream.-
Methods inherited from class com.github.javaparser.AbstractCharStream
adjustBeginLineColumn, backup, beginToken, done, expandBuff, fillBuff, getBeginColumn, getBeginLine, getBufSizeAfterExpansion, getColumn, getEndColumn, getEndLine, getImage, getLine, getSuffix, getTabSize, internalAdjustBuffSize, internalSetBufLineColumn, internalUpdateLineColumn, isTrackLineColumn, readChar, reInit, setTabSize, setTrackLineColumn
-
-
-
-
Constructor Detail
-
SimpleCharStream
public SimpleCharStream(Provider dstream, int startline, int startcolumn, int buffersize)
Constructor.
-
SimpleCharStream
public SimpleCharStream(Provider dstream, int startline, int startcolumn)
Constructor.
-
SimpleCharStream
public SimpleCharStream(Provider dstream)
Constructor.
-
-
Method Detail
-
streamRead
protected int streamRead(char[] aBuf, int nOfs, int nLen) throws IOException
Description copied from class:AbstractCharStream
Read from the underlying stream.- Specified by:
streamRead
in classAbstractCharStream
- Parameters:
aBuf
- the buffer to be fillednOfs
- The offset into the buffer. 0-basednLen
- Number of chars to read.- Returns:
- Number of effective chars read, or -1 on error.
- Throws:
IOException
-
streamClose
protected void streamClose() throws IOException
Description copied from class:AbstractCharStream
Close the underlying stream.- Specified by:
streamClose
in classAbstractCharStream
- Throws:
IOException
- If closing fails.
-
reInit
public void reInit(Provider dstream, int startline, int startcolumn, int buffersize)
Reinitialise.
-
reInit
public void reInit(Provider dstream, int startline, int startcolumn)
Reinitialise.
-
reInit
public void reInit(Provider dstream)
Reinitialise.
-
-