getNextEmptyOrOpener static method
Returns the next EMPTY or L_PAREN in the stream as uppercase text.
@return the next EMPTY or L_PAREN in the stream as uppercase text. @throws ParseException if the next token is not EMPTY or L_PAREN @throws IOException if an I/O error occurs @param tokenizer tokenizer over a stream of text in Well-known Text
Implementation
static String getNextEmptyOrOpener(WKTTokenizer tokenizer) {
String nextWord = getNextWord(tokenizer);
if (StringUtils.equalsIgnoreCase(nextWord, "Z")) {
//z = true;
nextWord = getNextWord(tokenizer);
} else if (StringUtils.equalsIgnoreCase(nextWord, "M")) {
//m = true;
nextWord = getNextWord(tokenizer);
} else if (StringUtils.equalsIgnoreCase(nextWord, "ZM")) {
//z = true;
//m = true;
nextWord = getNextWord(tokenizer);
}
if (nextWord == EMPTY || nextWord == L_PAREN) {
return nextWord;
}
throw ArgumentError(
"Expected $EMPTY or $L_PAREN token but found $nextWord");
}