Reputation: 3
I have an ArrayList of ArrayLists of T, and I am trying to find the index of the ArrayList that contains a certain object
private int indexOfItem(T item)
{
int index = 10000;
for(int i = 0; i < bigList.size(); i++)
{
if(bigList.get(i).contains(item))
{
index = i;
}
}
return index;
}
this works but is there a better way to do this using the indexOf() method that arrayLists have?
Upvotes: 0
Views: 1037