I have a problem with comparing two arraylist,
my first arraylist looks like this:
{TeamID=4, Group=A, TeamName=Germany}
{TeamID=6, Group=A, TeamName=Turkey}
my second list:
{TeamID=4, Chance=99.9%}
{TeamID=6, Chance=38.4%}
and then I want to create one list, which will look like this:
{TeamID=4, Group=A, TeamName=Germany Chance=99.9%}
{TeamID=6, Group=A, TeamName=Turkey Chance=38.4%}
Can You help me ?
First List:
private ArrayList<HashMap<String, String>> TeamList = this.xml.TeamListList;
Second:
private ArrayList<HashMap<String, String>> QChanceList = this.xml.QChanceListList;
Here’s one idea. For each team I search for the corresponding entry in the chances list, then I put all entries from both maps into a new one.
(This example is not very fail-safe, it asserts, that all maps have values for “TeamId”, I just demonstrate that something has to be done in case of illegal input, like an incomplete chances list)