public final class CharacterReader extends Object
Constructor | Description |
---|---|
CharacterReader(Reader input) |
|
CharacterReader(Reader input,
int sz) |
|
CharacterReader(String input) |
Modifier and Type | Method | 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(Reader input, int sz)
public CharacterReader(Reader input)
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 © 2009–2018 Jonathan Hedley. All rights reserved.