public interface StringStream
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead(int characters)
Tests whether the stream can read the given
characters count |
static @NotNull StringStream |
create(@NotNull java.lang.String source)
Returns an immutable
StringStream with the given source, starting
at the beginning of the string. |
static @NotNull StringStream |
create(@NotNull java.lang.String source,
int position)
Returns an immutable
StringStream with the given source and
cursor position |
static @NotNull MutableStringStream |
createMutable(@NotNull java.lang.String source)
Returns a mutable
MutableStringStream with the given source, starting
at the beginning of the string. |
static @NotNull MutableStringStream |
createMutable(@NotNull java.lang.String source,
int position)
Returns a mutable
MutableStringStream with the given source and
cursor position |
boolean |
hasFinished()
Tests whether this stream has finished parsing or not
|
boolean |
hasRemaining()
Tests whether there are any characters left in the string
stream
|
boolean |
isEmpty()
Tests whether is this stream empty or not.
|
boolean |
isMutable()
Tests whether is this stream mutable or not
|
char |
peek()
Peeks the next character, without moving the cursor forward.
|
java.lang.String |
peek(int characters)
Peeks the next number of character, without moving the cursor forward.
|
char |
peekOffset(int offset)
Peeks the character after
offset chars, without moving the cursor forward. |
@NotNull java.lang.String |
peekRemaining()
Peeks the remainder of the string stream
|
@NotNull java.lang.String |
peekString()
Peeks the next string.
|
@NotNull java.lang.String |
peekUnquotedString()
Peeks a single, unquoted string.
|
int |
position()
Returns the cursor position
|
int |
remaining()
Returns the characters remaining
|
@NotNull java.lang.String |
source()
Returns the original entire string source.
|
@NotNull @Unmodifiable StringStream |
toImmutableCopy()
Returns an
StringStream copy of this string stream |
@NotNull MutableStringStream |
toMutableCopy()
Returns a new, mutable
MutableStringStream copy of this stream. |
int |
totalSize()
Returns the size of the source
|
@NotNull static @NotNull StringStream create(@NotNull @NotNull java.lang.String source, int position)
StringStream with the given source and
cursor positionsource - The source string to work withposition - The cursor positionStringStream@NotNull static @NotNull StringStream create(@NotNull @NotNull java.lang.String source)
StringStream with the given source, starting
at the beginning of the string.source - The source string to work withStringStream@NotNull static @NotNull MutableStringStream createMutable(@NotNull @NotNull java.lang.String source, int position)
MutableStringStream with the given source and
cursor positionsource - The source string to work withposition - The cursor positionMutableStringStream@NotNull static @NotNull MutableStringStream createMutable(@NotNull @NotNull java.lang.String source)
MutableStringStream with the given source, starting
at the beginning of the string.source - The source string to work withMutableStringStream@NotNull @NotNull java.lang.String source()
int totalSize()
int remaining()
char peek()
java.lang.String peek(int characters)
char peekOffset(int offset)
offset chars, without moving the cursor forward.offset - Characters to peekboolean hasRemaining()
boolean hasFinished()
boolean canRead(int characters)
characters countcharacters - Number of charactersint position()
@NotNull @NotNull java.lang.String peekUnquotedString()
This will not move the cursor forward.
@NotNull @NotNull java.lang.String peekString()
This will not move the cursor forward.
@NotNull @NotNull java.lang.String peekRemaining()
@NotNull @NotNull @Unmodifiable StringStream toImmutableCopy()
StringStream copy of this string stream@NotNull @NotNull MutableStringStream toMutableCopy()
MutableStringStream copy of this stream.boolean isMutable()
boolean isEmpty()
This is equivalent to String.isEmpty()