From a31f87784690f71e47f36364af31448c254b2db1 Mon Sep 17 00:00:00 2001 From: jk KPADEY Date: Sat, 15 Feb 2020 14:51:48 +0100 Subject: [PATCH] Remove prefix of fields Signed-off-by: jk KPADEY --- .../github/mivek/command/AirportSupplier.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/io/github/mivek/command/AirportSupplier.java b/src/main/java/io/github/mivek/command/AirportSupplier.java index 7fdec993..411ced44 100644 --- a/src/main/java/io/github/mivek/command/AirportSupplier.java +++ b/src/main/java/io/github/mivek/command/AirportSupplier.java @@ -18,13 +18,13 @@ */ public final class AirportSupplier implements Supplier { /** Path of airport file. */ - private final InputStream fAirportsFile = AbstractParser.class.getClassLoader().getResourceAsStream("data/airports.dat"); + private final InputStream airportsFile = AbstractParser.class.getClassLoader().getResourceAsStream("data/airports.dat"); /** Path of countries file. */ - private final InputStream fCountriesFile = AbstractParser.class.getClassLoader().getResourceAsStream("data/countries.dat"); + private final InputStream countriesFile = AbstractParser.class.getClassLoader().getResourceAsStream("data/countries.dat"); /** Map of countries. */ - private Map fCountries; + private Map countries; /** Map of airports. */ - private Map fAirports; + private Map airports; /** * Constructor. @@ -38,14 +38,14 @@ public AirportSupplier() { * Initiate airports map. */ private void initAirports() { - fAirports = new HashMap<>(); + airports = new HashMap<>(); String[] line; - try (CSVReader reader = new CSVReader(new InputStreamReader(fAirportsFile, StandardCharsets.UTF_8))) { + try (CSVReader reader = new CSVReader(new InputStreamReader(airportsFile, StandardCharsets.UTF_8))) { while ((line = reader.readNext()) != null) { Airport airport = new Airport(); airport.setName(line[1]); airport.setCity(line[2]); - airport.setCountry(fCountries.get(line[3])); + airport.setCountry(countries.get(line[3])); airport.setIata(line[4]); airport.setIcao(line[5]); airport.setLatitude(Double.parseDouble(line[6])); @@ -53,7 +53,7 @@ private void initAirports() { airport.setAltitude(Integer.parseInt(line[8])); airport.setTimezone(line[9]); airport.setDst(line[10]); - fAirports.put(airport.getIcao(), airport); + airports.put(airport.getIcao(), airport); } } catch (IOException | CsvValidationException exception) { throw new IllegalStateException(exception.getMessage()); @@ -64,13 +64,13 @@ private void initAirports() { * Initiate countries map. */ private void initCountries() { - fCountries = new HashMap<>(); + countries = new HashMap<>(); String[] line; - try (CSVReader reader = new CSVReader(new InputStreamReader(fCountriesFile, StandardCharsets.UTF_8))) { + try (CSVReader reader = new CSVReader(new InputStreamReader(countriesFile, StandardCharsets.UTF_8))) { while ((line = reader.readNext()) != null) { Country country = new Country(); country.setName(line[0]); - fCountries.put(country.getName(), country); + countries.put(country.getName(), country); } } catch (IOException | CsvValidationException exception) { throw new IllegalStateException(exception.getMessage()); @@ -78,7 +78,7 @@ private void initCountries() { } @Override public Airport get(final String pIcao) { - return fAirports.get(pIcao); + return airports.get(pIcao); } }