summaryrefslogtreecommitdiff
path: root/src/main/java/com/benburwell/planes/data/Intersection.java
blob: 453d6bca076c61ee940cee9c1f99357587912446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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;
    }
}