Comparing objects: lists and maps
Hi guys! I'm having a big problem (both from a programmatic and efficiency point of view). Let me show you my problem.
On my application, I mainly work with the following object:
On my application, there's a method that needs to check if Page objects from list "A" are on list "B". The way to know this is through their String url attribute. Example
- Object1: attributeA, attributeB, attributeC
- Object2: attributeD, attributeE, attributeF
- Object3: attributeG, attributeH, attributeI
- Object4: attributeA, attributeB, attributeC
- Object5: attributeJ, attributeK, attributeL
- Object6: attributeM, attributeN, attributeO
The problems are facing are:
- How can I search for an object on a ArrayList? The list is NOT sorted
- I'm 100% sure that using a Map is better. Can somebody help me?
Thanks, and feel free to ask for more specifications