public class CharSequenceCharSource extends EmptyCharSource implements java.io.Serializable
is a CharSource
wrapper around a CharSequence
such that it can be used as an input source
of a DfaRun
.
Note: The length of the sequence provided is stored
locally in objects of this class and is not updated, if the length
of the sequence changes. This allows to use the tail of a
StringBuilder
, for example, for other purposes, while
the head of it is read by an object of this class.
Constructor and Description |
---|
CharSequenceCharSource() |
CharSequenceCharSource(java.lang.CharSequence s) |
CharSequenceCharSource(java.lang.CharSequence s,
int startAt) |
Modifier and Type | Method and Description |
---|---|
int |
read()
returns a single character or -1 to indicate end of file.
|
void |
setSource(java.lang.CharSequence s) |
void |
setSource(java.lang.CharSequence s,
int startAt) |
void |
setSource(java.lang.CharSequence s,
int startAt,
int end) |
pop, pop, pushBack
public CharSequenceCharSource()
public CharSequenceCharSource(java.lang.CharSequence s)
public CharSequenceCharSource(java.lang.CharSequence s, int startAt)
public void setSource(java.lang.CharSequence s)
public void setSource(java.lang.CharSequence s, int startAt)
public void setSource(java.lang.CharSequence s, int startAt, int end)
public int read()
CharSource
read
in interface CharSource
read
in class EmptyCharSource