Modifier and Type | Field and Description |
---|---|
String |
dimension
Dimensionality specifier (e.g.
|
int |
offset
Offset of the next char in
rawString to be read. |
String |
rawString
|
Modifier and Type | Method and Description |
---|---|
boolean |
eof()
If the string is consumed, i.e.
|
SpatialContext |
getCtx() |
WKTReader |
getParser() |
double |
nextDouble()
Reads in a double from the String.
|
void |
nextExpect(char expected)
Verifies that the current character is of the expected value.
|
boolean |
nextIf(char expected)
If the current character is
expected , then offset is advanced after it and any
subsequent whitespace. |
boolean |
nextIfEmptyAndSkipZM()
Skips over a dimensionality token (e.g.
|
void |
nextIfWhitespace()
Moves offset to next non-whitespace character.
|
String |
nextSubShapeString()
Returns the next chunk of text till the next ',' or ')' (non-inclusive) or EOF.
|
String |
nextWord()
Reads the word starting at the current character position.
|
void |
skipDouble()
Advances offset forward until it points to a character that isn't part of a number.
|
void |
skipNextDoubles()
Advances past as many doubles as there are, with intervening whitespace.
|
public String rawString
public int offset
rawString
to be read.public String dimension
public State(String rawString)
public SpatialContext getCtx()
public WKTReader getParser()
public String nextWord() throws ParseException
Character.isJavaIdentifierPart(char)
returns false (or EOF). offset
is
advanced past whitespace.ParseException
public boolean nextIfEmptyAndSkipZM() throws ParseException
dimension
,
and then looks for EMPTY, consuming that and whitespace.
dimensionToken? 'EMPTY'?
ParseException
public double nextDouble() throws ParseException
offset
is advanced past whitespace.ParseException
public void skipDouble()
public void skipNextDoubles()
public void nextExpect(char expected) throws ParseException
offset
is advanced past whitespace.expected
- The expected char.ParseException
public final boolean eof()
public boolean nextIf(char expected)
expected
, then offset is advanced after it and any
subsequent whitespace. Otherwise, false is returned.expected
- The expected charpublic void nextIfWhitespace()
public String nextSubShapeString() throws ParseException
Example:
OUTER(INNER(3, 5))If this is called when offset is at the first character, then it will return this whole string. If called at the "I" then it will return "INNER(3, 5)". If called at "3", then it will return "3". In all cases, offset will be positioned at the next position following the returned substring.
ParseException
Copyright © 2020 LocationTech. All rights reserved.