Let's say I've got this two ArrayLists, the first one is of the type ObjectA, the second ObjectB.
These are ObjectA's variables:
int id;
double value;
And these are ObjectB's variables:
int objAId;
double disccountValue;
How can I retrieve the disccountValue of ObjectB where objAId is the same of the item on the first list? Just like in a SQL query, but in ArrayLists.
listAbased on a givenobjAIdfrom anObjectB. If you sortlistAby theidvalue, you can improve the speed by doing a binary search instead.listB, you can do either a linear or binary search depending on whether you sort the list before searching.