20 package org.matsim.core.population.io;
22 import org.apache.logging.log4j.LogManager;
23 import org.apache.logging.log4j.Logger;
31 import java.io.BufferedWriter;
32 import java.io.IOException;
41 private final static Logger log = LogManager.getLogger(AbstractPopulationWriterHandler.class);
44 public final void writePerson(
final Person person,
final BufferedWriter writer)
throws IOException {
45 this.startPerson(person, writer);
49 this.startTravelCard(t, writer);
50 this.endTravelCard(writer);
55 this.startPlan(plan, writer);
57 for (Object pe : plan.getPlanElements()) {
59 Activity act = (Activity) pe;
60 this.startAct(act, writer);
63 else if (pe instanceof
Leg) {
65 this.startLeg(leg, writer);
69 this.startRoute(route, writer);
70 this.endRoute(writer);
77 this.endPerson(writer);
78 this.writeSeparator(writer);
81 public abstract void startPerson(
final Person person,
final BufferedWriter out)
throws IOException;
83 public abstract void endPerson(
final BufferedWriter out)
throws IOException;
85 public abstract void startTravelCard(
final String travelcard,
final BufferedWriter out)
throws IOException;
87 public abstract void endTravelCard(
final BufferedWriter out)
throws IOException;
89 public abstract void startPlan(
final Plan plan,
final BufferedWriter out)
throws IOException;
91 public abstract void endPlan(
final BufferedWriter out)
throws IOException;
93 public abstract void startAct(
final Activity act,
final BufferedWriter out)
throws IOException;
95 public abstract void endAct(
final BufferedWriter out)
throws IOException;
97 public abstract void startLeg(
final Leg leg,
final BufferedWriter out)
throws IOException;
99 public abstract void endLeg(
final BufferedWriter out)
throws IOException;
101 public abstract void startRoute(
final Route route,
final BufferedWriter out)
throws IOException;
103 public abstract void endRoute(
final BufferedWriter out)
throws IOException;
static TreeSet< String > getTravelcards(Person person)
abstract List<? extends T > getPlans()