Class HistoricalCurrencyConverter

java.lang.Object
org.episteme.social.history.HistoricalCurrencyConverter

public final class HistoricalCurrencyConverter extends Object
Converts historical currencies and adjusts for inflation using purchasing power parity (PPP). Provides mappings for major historical currencies and their estimated modern value.
Since:
1.0
Version:
1.1
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • convert

      public static Real convert(Real amount, String fromCurrency, String toCurrency, int year)
      Converts a monetary amount between two historical currencies at a specific year.
      Parameters:
      amount - the amount to convert
      fromCurrency - key of source currency
      toCurrency - key of target currency
      year - the historical year
      Returns:
      converted amount as a Real number
      Throws:
      NullPointerException - if any string or Real argument is null
      IllegalArgumentException - if currency is unknown or not in circulation
    • adjustForInflation

      public static Real adjustForInflation(Real amount, String currency, int fromYear, int toYear)
      Adjusts a monetary amount for inflation within the same currency.
      Parameters:
      amount - the original amount
      currency - currency key
      fromYear - starting year
      toYear - target year
      Returns:
      inflation-adjusted amount as a Real number
      Throws:
      NullPointerException - if amount or currency is null
    • toModernUSD

      public static Real toModernUSD(Real amount, String currency, int year)
      Converts a historical amount to its equivalent 2020 US Dollar value.
      Parameters:
      amount - the historical amount
      currency - currency key
      year - historical year
      Returns:
      modern USD equivalent as a Real number
      Throws:
      NullPointerException - if amount or currency is null
    • toDaysLabor

      public static Real toDaysLabor(Real amount, String currency, int year)
      Estimates the human effort value (days of labor) represented by a monetary amount.
      Parameters:
      amount - the monetary amount
      currency - currency key
      year - historical year
      Returns:
      estimated number of days of labor to earn this amount as a Real number
      Throws:
      NullPointerException - if amount or currency is null
    • getAvailableCurrencies

      public static List<HistoricalCurrencyConverter.Currency> getAvailableCurrencies(int year)
      Returns a list of currencies known to be in circulation during a specific year.
      Parameters:
      year - the year to query
      Returns:
      unmodifiable list of circulating currencies