Package org.pipservices3.expressions.io
Class StringScanner
java.lang.Object
org.pipservices3.expressions.io.StringScanner
- All Implemented Interfaces:
IScanner
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcolumn()Gets the column in the current lineintline()Gets the current line numberintpeek()Returns the character from the top of the stream without moving the stream pointer.intGets the next character column numberintpeekLine()Gets the next character line numberintread()Reads character from the top of the stream.voidreset()Resets scanner to the initial positionvoidunread()Puts the one character back into the stream stream.voidunreadMany(int count) Pushes the specified number of characters to the top of the stream.
-
Field Details
-
EOF
public static final int EOF- See Also:
-
-
Constructor Details
-
StringScanner
Creates an instance of this class.- Parameters:
content- A text content to be read.
-
-
Method Details
-
line
public int line()Gets the current line number -
column
public int column()Gets the column in the current line -
read
public int read()Reads character from the top of the stream. A read character or-1if stream processed to the end. -
peek
public int peek()Returns the character from the top of the stream without moving the stream pointer. -
peekLine
public int peekLine()Gets the next character line number -
peekColumn
public int peekColumn()Gets the next character column number- Specified by:
peekColumnin interfaceIScanner- Returns:
- The next character column number in the stream
-
unread
public void unread()Puts the one character back into the stream stream. -
unreadMany
public void unreadMany(int count) Pushes the specified number of characters to the top of the stream.- Specified by:
unreadManyin interfaceIScanner- Parameters:
count- A number of characcted to be pushed back.
-
reset
public void reset()Resets scanner to the initial position
-