Package org.w3c.tidy
Class StreamInJavaImpl
- java.lang.Object
-
- org.w3c.tidy.StreamInJavaImpl
-
-
Field Summary
Fields Modifier and Type Field Description private intbufposactual position in buffer.private int[]charbufcharacter buffer.private static intCHARBUF_SIZEnumber of characters kept in buffer.private intcurcolcurrent column number.private intcurlinecurrent line number.private booleanendOfStreamhas end of stream been reached?private intlastcollast column.private booleanpushedIs char pushed?private java.io.ReaderreaderJava input stream reader.private inttabsprivate inttabsizetab size in chars.-
Fields inherited from interface org.w3c.tidy.StreamIn
END_OF_STREAM
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedStreamInJavaImpl(java.io.InputStream stream, java.lang.String encoding, int tabsize)Instantiates a new StreamInJavaImpl.protectedStreamInJavaImpl(java.io.Reader reader, int tabsize)Instantiates a new StreamInJavaImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCurcol()Getter forcurcol.intgetCurline()Getter forcurline.booleanisEndOfStream()Has end of stream been reached?intreadChar()Read a char.intreadCharFromStream()reads a char from the stream.voidsetLexer(Lexer lexer)Setter for lexer instance (needed for error reporting).voidungetChar(int c)Unget a char.
-
-
-
Field Detail
-
CHARBUF_SIZE
private static final int CHARBUF_SIZE
number of characters kept in buffer.- See Also:
- Constant Field Values
-
charbuf
private int[] charbuf
character buffer.
-
bufpos
private int bufpos
actual position in buffer.
-
reader
private java.io.Reader reader
Java input stream reader.
-
endOfStream
private boolean endOfStream
has end of stream been reached?
-
pushed
private boolean pushed
Is char pushed?
-
curcol
private int curcol
current column number.
-
lastcol
private int lastcol
last column.
-
curline
private int curline
current line number.
-
tabsize
private int tabsize
tab size in chars.
-
tabs
private int tabs
-
-
Constructor Detail
-
StreamInJavaImpl
protected StreamInJavaImpl(java.io.InputStream stream, java.lang.String encoding, int tabsize) throws java.io.UnsupportedEncodingExceptionInstantiates a new StreamInJavaImpl.- Parameters:
stream-encoding-tabsize-- Throws:
java.io.UnsupportedEncodingException
-
StreamInJavaImpl
protected StreamInJavaImpl(java.io.Reader reader, int tabsize)Instantiates a new StreamInJavaImpl.- Parameters:
stream-encoding-tabsize-
-
-
Method Detail
-
readCharFromStream
public int readCharFromStream()
Description copied from interface:StreamInreads a char from the stream.- Specified by:
readCharFromStreamin interfaceStreamIn- Returns:
- char
- See Also:
StreamIn.readCharFromStream()
-
readChar
public int readChar()
Description copied from interface:StreamInRead a char.- Specified by:
readCharin interfaceStreamIn- Returns:
- char
- See Also:
StreamIn.readChar()
-
ungetChar
public void ungetChar(int c)
Description copied from interface:StreamInUnget a char.- Specified by:
ungetCharin interfaceStreamIn- Parameters:
c- char- See Also:
StreamIn.ungetChar(int)
-
isEndOfStream
public boolean isEndOfStream()
Description copied from interface:StreamInHas end of stream been reached?- Specified by:
isEndOfStreamin interfaceStreamIn- Returns:
trueif end of stream has been reached- See Also:
StreamIn.isEndOfStream()
-
getCurcol
public int getCurcol()
Getter forcurcol.
-
getCurline
public int getCurline()
Getter forcurline.- Specified by:
getCurlinein interfaceStreamIn- Returns:
- Returns the curline.
-
setLexer
public void setLexer(Lexer lexer)
Description copied from interface:StreamInSetter for lexer instance (needed for error reporting).- Specified by:
setLexerin interfaceStreamIn- Parameters:
lexer- Lexer- See Also:
StreamIn.setLexer(org.w3c.tidy.Lexer)
-
-