I have this ArrayList - ArrayList<Object[]> tree
...
I also have this Array - Object[] move
...that has a size of 2.
In my program a unique 2D array is added to move[0]
and an integer to move[1]
. This array is then added to the ArrayList then the process is repeated so I have a list of 'moves'.
My problem is I am unsure how to find the arrays ('moves') within the ArrayList ('tree') that contain a certain value in the move[1]
element only - as the move[0]
element will be unique everytime.
I then want to make an array/list of all of the matches. For example, an array that contains all of the move[0]
values that match up to the move[1]
value of 3
. So I would be left with an array/list of 2D arrays that contain the required moves.
Thanks, Matt
Point
, instead of a 2d array (Object[]
). – Bhesh Gurung Apr 22 '12 at 20:02ArrayList<Object[]>
use aMap<String, Object[]>
and have a String constantMOVES
to identify your 2D array – Luiggi Mendoza Apr 22 '12 at 20:02