Re: check values of Boolean array
On May 21, 11:10 am, mike <mikaelpetter...@hotmail.com> wrote:
Hi,
I have the following array:
Object [] myValues = new Boolean[] {new Boolean(false), new
Boolean(true)};
How can I check that myValues is a an array of Booleans?
In relation to this I need to make sure that I have unique series of
values.
If I have the following params param1, param2, param3 and so on
I have combinations 2 power n ( which is number of params). How can I
make sure I use all combinations?
cheers,
//mikael
I don't think you can check the entire array. But I'm pretty sure
that you could do something like
public boolean checkArray(Object [] ArrayToCheck)
{
int i = 0;
while (i <= ArrayToCheck.length)
{
Object test = ArrayToCheck[i]
if ( test.instanceof(boolean) == false)
return false;
}
return true;
}
Any of the experts have any criticism?
I made this up on the fly, it's un-tested and I don't know if it will
compile.