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 TypeMethodDescriptionint
column()
Gets the column in the current lineint
line()
Gets the current line numberint
peek()
Returns the character from the top of the stream without moving the stream pointer.int
Gets the next character column numberint
peekLine()
Gets the next character line numberint
read()
Reads character from the top of the stream.void
reset()
Resets scanner to the initial positionvoid
unread()
Puts the one character back into the stream stream.void
unreadMany
(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-1
if 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:
peekColumn
in 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:
unreadMany
in interfaceIScanner
- Parameters:
count
- A number of characcted to be pushed back.
-
reset
public void reset()Resets scanner to the initial position
-