I have a card that stores the time series data of a person’s salary in the following format
HashMap<Date,Double> salaryHistory;
A variable salaryHistorycan have data from 1AD to 2100AD.
I use subMapto filter data from a hash map, but this is a task in the following scenario
Consider the salary of a person like this
Jan-01-1969, 100
Jan-01-1979, 200
When a user requests a salary from January 1 to January 1, 1970, subMapreturns "null", but in fact he should return 100, since in 1969 the person’s salary was 100, and it never changed until 1979.
Is there an easy way to do this? Like a library.
Please provide your valuable suggestions.