/** * Reads a <code>CoordinateSequence</Code> from a stream using the given {@link StreamTokenizer}. * <p> * All ordinate values are read, but -depending on the {@link CoordinateSequenceFactory} of the * underlying {@link GeometryFactory}- not necessarily all can be handled. Those are silently dropped. * </p> * @param tokenizer the tokenizer to use * @param ordinateFlags a bit-mask defining the ordinates to read. * @param tryParen a value indicating if a starting {@link #L_PAREN} should be probed for each coordinate. * @return a {@link CoordinateSequence} of length 1 containing the read ordinate values * *@throws IOException if an I/O error occurs *@throws ParseException if an unexpected token was encountered S */ private CoordinateSequence getCoordinateSequence(StreamTokenizer tokenizer, EnumSet<Ordinate> ordinateFlags, boolean tryParen) throws IOException, ParseException { if (getNextEmptyOrOpener(tokenizer).equals(EMPTY)) return this.csFactory.create(0, toDimension(ordinateFlags), ordinateFlags.contains(Ordinate.M) ? 1 : 0); ArrayList coordinates = new ArrayList(); do { coordinates.add(getCoordinate(tokenizer, ordinateFlags, tryParen)); } while (getNextCloserOrComma(tokenizer).equals(COMMA)); return mergeSequences(coordinates, ordinateFlags); }