21 package org.matsim.counts;
23 import org.apache.logging.log4j.LogManager;
24 import org.apache.logging.log4j.Logger;
31 import org.xml.sax.Attributes;
33 import java.util.Stack;
42 private final static String
COUNTS =
"counts";
43 private final static String
COUNT =
"count";
44 private final static String
VOLUME =
"volume";
67 if (VOLUME.equals(name)) {
69 }
else if (COUNT.equals(name)) {
71 }
else if (COUNTS.equals(name)) {
77 public void endTag(
final String name,
final String content,
final Stack<String> context) {
82 this.counts.
setName(meta.getValue(
"name"));
84 this.counts.
setYear(Integer.parseInt(meta.getValue(
"year")));
88 String locId = meta.getValue(
"loc_id");
90 String x = meta.getValue(
"x");
91 String y = meta.getValue(
"y");
92 if (x != null && y != null) {
96 Double.parseDouble(x),
97 Double.parseDouble(y))));
102 if (this.currcount != null) {
103 this.currcount.
createVolume(Integer.parseInt(meta.getValue(
"h")), Double.parseDouble(meta.getValue(
"val")));
CountsReaderMatsimV1(final Counts counts)
final CoordinateTransformation coordinateTransformation
void startCounts(final Attributes meta)
void setName(String name)
void setCoord(final Coord coord)
static< T > Id< T > create(final long key, final Class< T > type)
void setDescription(String description)
final Volume createVolume(final int h, final double val)
static final String VOLUME
static final String COUNT
void endTag(final String name, final String content, final Stack< String > context)
void startVolume(final Attributes meta)
void startTag(final String name, final Attributes atts, final Stack< String > context)
CountsReaderMatsimV1(final CoordinateTransformation coordinateTransformation, final Counts counts)
void startCount(final Attributes meta)
static final String COUNTS
final Count< T > createAndAddCount(final Id< T > linkId, final String stationName)
Old API.