public class Char extends Object implements Position
LookaheadReader
.
Provides the value as well as an exact position of the character in the stream. Also some test methods are provided to determine the character class of the internal value.
LookaheadReader
Modifier and Type | Method and Description |
---|---|
int |
getLine()
Returns the line number of this position.
|
int |
getPos()
Returns the character position within the line of this position
|
String |
getStringValue()
Returns the internal value as string.
|
char |
getValue()
Returns the value of this char.
|
boolean |
is(char... tests)
Checks if the internal value is one of the given characters
|
boolean |
isDigit()
Determines if the value is a digit (0..9)
|
boolean |
isEndOfInput()
Determines if this instance represents the end of input indicator
|
boolean |
isLetter()
Determines if the value is a letter (a..z, A..Z)
|
boolean |
isNewLine()
Determines if the value is a line break
|
boolean |
isWhitepace()
Determines if the value is a whitespace character like a blank, tab or line break
|
String |
toString() |
public char getValue()
public int getLine()
Position
public int getPos()
Position
public boolean isDigit()
public boolean isLetter()
public boolean isWhitepace()
public boolean isNewLine()
public boolean isEndOfInput()
public boolean is(char... tests)
tests
- the characters to check againstpublic String getStringValue()
Copyright © 2020. All rights reserved.