public final class CharacterReader extends Object
Constructor and Description |
---|
CharacterReader(String input) |
Modifier and Type | Method and Description |
---|---|
void |
advance()
Moves the current position by one.
|
String |
consumeTo(char c)
Reads characters up to the specific char.
|
String |
consumeToAny(char... chars)
Read characters until the first of any delimiters is found.
|
char |
current()
Get the char at the current position.
|
boolean |
isEmpty()
Tests if all the content has been read.
|
int |
pos()
Gets the current cursor position in the content.
|
String |
toString() |
public CharacterReader(String input)
public int pos()
public boolean isEmpty()
public char current()
public void advance()
public String consumeTo(char c)
c
- the delimiterpublic String consumeToAny(char... chars)
chars
- delimiters to scan forCopyright © 2017. All rights reserved.