From 7411558abf4aba7d600bb9fc713d36032e4a6df3 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Sun, 20 Nov 2016 02:38:23 -0500 Subject: Show routes --- .../com/benburwell/planes/data/Intersection.java | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/main/java/com/benburwell/planes/data/Intersection.java (limited to 'src/main/java/com/benburwell/planes/data') diff --git a/src/main/java/com/benburwell/planes/data/Intersection.java b/src/main/java/com/benburwell/planes/data/Intersection.java new file mode 100644 index 0000000..453d6bc --- /dev/null +++ b/src/main/java/com/benburwell/planes/data/Intersection.java @@ -0,0 +1,50 @@ +package com.benburwell.planes.data; + +import org.apache.commons.csv.CSVRecord; + +/** + * @author ben + */ +public class Intersection extends AbstractCSVReader { + private String airway1; + private String airway2; + private String center; + private double latitude; + private double longitude; + private int numberedFix; + + @Override + public void readRecord(CSVRecord record) { + String[] airways = record.get("Airways").split(" "); + this.airway1 = airways[0]; + this.airway2 = airways[1]; + this.center = record.get("Center"); + this.latitude = Double.valueOf(record.get("Latitude")); + this.longitude = Double.valueOf(record.get("Longitude")); + this.numberedFix = Integer.valueOf(record.get("Numbered Fix")); + } + + public String getAirway1() { + return airway1; + } + + public String getAirway2() { + return airway2; + } + + public String getCenter() { + return center; + } + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + public int getNumberedFix() { + return numberedFix; + } +} -- cgit v1.2.3