21 package org.matsim.matrices;
23 import java.io.BufferedWriter;
24 import java.io.IOException;
26 class MatricesWriterHandlerImplV1
implements MatricesWriterHandler {
43 public void startMatrices(
final Matrices matrices,
final BufferedWriter out)
throws IOException {
44 out.write(
"<matrices");
45 if (matrices.getName() != null) {
46 out.write(
" name=\"" + matrices.getName() +
"\"");
52 public void endMatrices(
final BufferedWriter out)
throws IOException {
53 out.write(
"</matrices>\n");
61 public void startMatrix(
final Matrix matrix,
final BufferedWriter out)
throws IOException {
62 out.write(
"\t<matrix");
63 out.write(
" id=\"" + matrix.getId() +
"\"");
65 if (matrix.getDesc() != null) {
66 out.write(
" desc=\"" + matrix.getDesc() +
"\"");
72 public void endMatrix(
final BufferedWriter out)
throws IOException {
73 out.write(
"\t</matrix>\n\n");
81 public void startEntry(
final Entry entry,
final BufferedWriter out)
throws IOException {
82 out.write(
"\t\t<entry");
83 out.write(
" from_id=\"" + entry.getFromLocation() +
"\"");
84 out.write(
" to_id=\"" + entry.getToLocation() +
"\"");
85 out.write(
" value=\"" + entry.getValue() +
"\"");
90 public void endEntry(
final BufferedWriter out)
throws IOException {
98 public void writeSeparator(
final BufferedWriter out)
throws IOException {
99 out.write(
"<!-- =================================================" +
100 "===================== -->\n\n");