Class DataAnalysis

java.lang.Object
comp3111.covid.DataAnalysis

public class DataAnalysis
extends java.lang.Object
Data Explorer on COVID-19
  • Constructor Summary

    Constructors 
    Constructor Description
    DataAnalysis()  
  • Method Summary

    Modifier and Type Method Description
    static javafx.collections.ObservableList casesAndDeathsData​(java.lang.String dataset, java.lang.String countryAISO, java.lang.String countryBISO)
    Search for the confirmed cases and confirmed deaths that match the given two countries.
    static java.util.Map<java.lang.String,​java.lang.String> getAllLocationIso​(java.lang.String dataset)  
    static java.lang.String getConfirmedCases​(java.lang.String dataset, java.lang.String iso_code)
    Retrieves the confirmed cases from given dataset for a country.
    static java.lang.String getConfirmedDeaths​(java.lang.String dataset, java.lang.String iso_code)
    Retrieves the confirmed deaths from given dataset for a country.
    static org.apache.commons.csv.CSVParser getFileParser​(java.lang.String dataset)  
    static java.lang.Float[] getQuartiles​(java.lang.String iDataset, java.lang.String variable)  
    static java.lang.String getRateOfVaccination​(java.lang.String dataset, java.lang.String iso_code)
    Retrieves the rate of vaccination from given dataset for a country.
    static java.time.LocalDate getValidDate​(java.lang.String dataset, java.time.LocalDate date)
    Gets a valid date that is available in the dataset.
    static java.util.List<java.time.LocalDate> getValidPeriod​(java.lang.String dataset)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getFileParser

      public static org.apache.commons.csv.CSVParser getFileParser​(java.lang.String dataset)
      Parameters:
      dataset - Filename of dataset
      Returns:
      CSVParser
    • getConfirmedCases

      public static java.lang.String getConfirmedCases​(java.lang.String dataset, java.lang.String iso_code)
      Retrieves the confirmed cases from given dataset for a country.
      Parameters:
      dataset - dataset
      iso_code - country ISO
      Returns:
      confirmed cases
    • getConfirmedDeaths

      public static java.lang.String getConfirmedDeaths​(java.lang.String dataset, java.lang.String iso_code)
      Retrieves the confirmed deaths from given dataset for a country.
      Parameters:
      dataset - dataset
      iso_code - country ISO
      Returns:
      confirmed deaths
    • getRateOfVaccination

      public static java.lang.String getRateOfVaccination​(java.lang.String dataset, java.lang.String iso_code)
      Retrieves the rate of vaccination from given dataset for a country.
      Parameters:
      dataset - dataset
      iso_code - country ISO
      Returns:
      rate of vaccination
    • getValidDate

      public static java.time.LocalDate getValidDate​(java.lang.String dataset, java.time.LocalDate date)
      Gets a valid date that is available in the dataset.
      Parameters:
      dataset - dataset
      date - date to check
      Returns:
      valid date
    • getValidPeriod

      public static java.util.List<java.time.LocalDate> getValidPeriod​(java.lang.String dataset)
      Parameters:
      dataset - Filename of dataset
      Returns:
      Earliest and latest date in dataset
    • getAllLocationIso

      public static java.util.Map<java.lang.String,​java.lang.String> getAllLocationIso​(java.lang.String dataset)
      Parameters:
      dataset - Filename for dataset
      Returns:
      Map for location and ISO codes
    • casesAndDeathsData

      public static javafx.collections.ObservableList casesAndDeathsData​(java.lang.String dataset, java.lang.String countryAISO, java.lang.String countryBISO)
      Search for the confirmed cases and confirmed deaths that match the given two countries.
      Parameters:
      dataset - dataset to be searched.
      countryAISO - ISO representation for the first country.
      countryBISO - ISO representation for the second country.
      Returns:
      A list that contains the confirmed cases and confirmed deaths.
    • getQuartiles

      public static java.lang.Float[] getQuartiles​(java.lang.String iDataset, java.lang.String variable)
      Parameters:
      iDataset - Filename of dataset
      variable - Target variable to get the quartiles
      Returns:
      4 quartile values