/** * Returns the next ordinate flag information in the stream as uppercase text. * This can be Z, M or ZM. * *@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 */ private static EnumSet<Ordinate> getNextOrdinateFlags(StreamTokenizer tokenizer) throws IOException, ParseException { EnumSet<Ordinate> result = EnumSet.of(Ordinate.X, Ordinate.Y); String nextWord = lookAheadWord(tokenizer).toUpperCase(); if (nextWord.equalsIgnoreCase("Z")) { tokenizer.nextToken(); result.add(Ordinate.Z); } else if (nextWord.equalsIgnoreCase("M")) { tokenizer.nextToken(); result.add(Ordinate.M); } else if (nextWord.equalsIgnoreCase("ZM")) { tokenizer.nextToken(); result.add(Ordinate.Z); result.add(Ordinate.M); } return result; }