I have problem with Java\'s ArrayList. I\'ve created an Object, that contains two attributes, x and y. Now I\'ve loaded some object in my ArrayList. Problem is that I don\'t
Just iterate over the list and test every element.
for (int i = 0; i < list.size(); i++) {
if (list.get(i).getX() == someValue) { // Or use equals() if it actually returns an Object.
// Found at index i. Break or return if necessary.
}
}
Verbose, yes, but possibly until JDK7 with Closures, there is no other standard way.