I am trying to use ArrayList.indexOf(Object elem) and i get method selection Exception
This works... dont know why.. <cfscript> xArray = listToArray("1,2,3,4,5",","); xIdx = xArray.indexOf("4");// this returns 3.. since arrays start with zero index in Java. </cfscript>
But when i return an ArrayList from Java.. and search ArrayList Object, i get method selection exceptions.. indexOf is not overloaded for ArrayList but is overloaded for vectors.. Any Ideas how i can get this to work?
I'm not sure what the problem is here, but this code works:
<cfscript>
// This is a Vector
xArray = listToArray("1,2,3,4,5",",");
xIdx = xArray.indexOf("4");
writeOutput(xIdx);// This is an ArrayList
myArrayList = createObject("java", "java.util.ArrayList");
myArrayList.add("a");
myArrayList.add("b");
myArrayList.add("c");
writeOutput(myArrayList.indexOf("b"));
</cfscript>Am I missing the issue?
Christian
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
