appendSequenceText method

void appendSequenceText(
  1. CoordinateSequence seq,
  2. List<Ordinate> outputOrdinates,
  3. bool useFormatting,
  4. int level,
  5. bool indentFirst,
  6. StringBuffer writer,
  7. NumberFormat formatter,
)

Appends all members of a CoordinateSequence to the stream. Each {@code Coordinate} is separated from another using a colon, the ordinates of a {@code Coordinate} are separated by a space.

@param seq the CoordinateSequence to process @param useFormatting flag indicating that @param level the indentation level @param indentFirst flag indicating that the first {@code Coordinate} of the sequence should be indented for better visibility @param writer the output writer to append to @param formatter the formatter to use for writing ordinate values.

Implementation

void appendSequenceText(
    CoordinateSequence seq,
    List<Ordinate> outputOrdinates,
    bool useFormatting,
    int level,
    bool indentFirst,
    StringBuffer writer,
    NumberFormat formatter) {
  if (seq.size() == 0) {
    writer.write("EMPTY");
  } else {
    if (indentFirst) indent(useFormatting, level, writer);
    writer.write("(");
    for (int i = 0; i < seq.size(); i++) {
      if (i > 0) {
        writer.write(", ");
        if (coordsPerLine > 0 && i % coordsPerLine == 0) {
          indent(useFormatting, level + 1, writer);
        }
      }
      appendCoordinate(seq, outputOrdinates, i, writer, formatter);
    }
    writer.write(")");
  }
}