I want to find if the property numb
in the ArrayList
grids
contains a certain value or not. Then I want to get the index of the entry that contains that value.
public class Grid {
public int numb;
public GridSeg(int numb) {
this.numb = numb;
}
}
public ArrayList<Grid> grids = new ArrayList<Grid>();
for (int i = 0; i < 6; i++) {
Grid grid = new Grid(i);
grids.add(grid);
}
/pseudo code since I don't know how it is done
if (grids.numb.contains(12)) {
if (grid.numb == 12) //get grid index
}