MATSIM
MatsimVehicleWriter.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * VehicleDefinitionsWriterV1
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2008 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 package org.matsim.vehicles;
21 
22 import java.io.IOException;
23 
24 import org.apache.logging.log4j.LogManager;
25 import org.apache.logging.log4j.Logger;
26 import org.matsim.core.gbl.Gbl;
28 
34 public final class MatsimVehicleWriter extends MatsimXmlWriter {
35 
36  private static final Logger log = LogManager.getLogger(MatsimVehicleWriter.class);
37 
38  private VehicleWriterV2 delegate;
39 
40  public MatsimVehicleWriter(Vehicles vehicles) {
41  delegate = new VehicleWriterV2(vehicles);
42  }
43 
48  public void writeFile(String filename) {
49  log.info( Gbl.aboutToWrite( "vehicles", filename) ) ;
50  try{
51  delegate.writeFile(filename);
52  } catch( IOException e ){
53  e.printStackTrace();
54  }
55  }
56 
57 }
static String aboutToWrite(String what, String filename)
Definition: Gbl.java:254