I have an arraylist full of different types of an object. (i.e an objects that extend a superobject)
an example is:
{object1, object1, object2, object3}
Now what I need to do is effectively pull a random object out of the array list. If it matches a set of criteria it will then run a method of this object. Otherwise it will run again till it finds an object till it does.
Now the reason why I can't just go over the objects from start to finish is because I need to provide some form of distribution.
How would I go about this? I know how to iterate over an array list, but Randomly inspecting an object in an array is out of my scope.