I don't think there automatic way to remove duplicates, but someone may know otherwise
I'd go through each item and save it in a temp, then use the get indexOf(temp) to get the first index number and compare it to lastIndexOf(temp), if they don't match remove the lastIndexOf one, keep doing until indexOf(temp)==lastIndexOf(temp).
Then
myOldArrayList.trimToSize()
and
ArrayList myNewArrayList=new ArrayList(myOldArrayList);
Just the way I'd go about it...
Last edited by Looking_Lost; 10-11-2003 at 03:15 PM.
|