What is the best option to convert the data from String to unique int IDs .For example
UserName, MovieType , year watched
John , Comedy , 2000
John , Comedy , 2012
Alis , Comedy , 2005
Alis, Animation , 2003
TO
UserName, MovieType , year watched
1, 4, 2000
1, 4, 2012
2, 4, 2005
2,3,2003
I was thinking to add UserName and MovieType to Sets to get a unique lists first. Then create a Map for each of them. My question now , how I can use the 2 Maps to read and compare with original data (table 1) to create new data (table 2). Assume I used Map> for table 1.
Thanks
You can see the working example here:
import java.util.HashMap;
import java.util.Map;