Class HistoricalCurrencyConverter
java.lang.Object
org.episteme.social.history.HistoricalCurrencyConverter
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)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a historical currency and its period of circulation.static final recordHistorical exchange rate between two currencies. -
Method Summary
Modifier and TypeMethodDescriptionstatic RealadjustForInflation(Real amount, String currency, int fromYear, int toYear) Adjusts a monetary amount for inflation within the same currency.static RealConverts a monetary amount between two historical currencies at a specific year.getAvailableCurrencies(int year) Returns a list of currencies known to be in circulation during a specific year.static RealtoDaysLabor(Real amount, String currency, int year) Estimates the human effort value (days of labor) represented by a monetary amount.static RealtoModernUSD(Real amount, String currency, int year) Converts a historical amount to its equivalent 2020 US Dollar value.
-
Method Details
-
convert
Converts a monetary amount between two historical currencies at a specific year.- Parameters:
amount- the amount to convertfromCurrency- key of source currencytoCurrency- key of target currencyyear- the historical year- Returns:
- converted amount as a
Realnumber - Throws:
NullPointerException- if any string or Real argument is nullIllegalArgumentException- if currency is unknown or not in circulation
-
adjustForInflation
Adjusts a monetary amount for inflation within the same currency.- Parameters:
amount- the original amountcurrency- currency keyfromYear- starting yeartoYear- target year- Returns:
- inflation-adjusted amount as a
Realnumber - Throws:
NullPointerException- if amount or currency is null
-
toModernUSD
Converts a historical amount to its equivalent 2020 US Dollar value.- Parameters:
amount- the historical amountcurrency- currency keyyear- historical year- Returns:
- modern USD equivalent as a
Realnumber - Throws:
NullPointerException- if amount or currency is null
-
toDaysLabor
Estimates the human effort value (days of labor) represented by a monetary amount.- Parameters:
amount- the monetary amountcurrency- currency keyyear- historical year- Returns:
- estimated number of days of labor to earn this amount as a
Realnumber - Throws:
NullPointerException- if amount or currency is null
-
getAvailableCurrencies
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
-