private static ArrayListMultimap<Long, SpeedRestriction> loadSpeedRestrictions(String filename) {
ArrayListMultimap<Long, SpeedRestriction> restrictions = ArrayListMultimap.create();
File file = new File(filename);
if (!file.exists()) {
log.info("File not found : {}", file.getAbsolutePath());
return restrictions;
}
log.info("Reading SR {}", file);
try (DbfReader reader = new DbfReader(file)) {
DbfRow row;
while ((row = reader.nextRow()) != null) {
SpeedRestriction restriction = new SpeedRestriction(row.getLong("ID"), row.getInt("SPEED"), Validity.values()[row.getInt("VALDIR") - 1]);
restrictions.put(restriction.getId(), restriction);
}
}
log.info("Loaded {} speed restrictions", restrictions.size());
return restrictions;
}
SrDbf.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:fpm
作者:
评论列表
文章目录