We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Using java.util.List in processing
Page Index Toggle Pages: 1
Using java.util.List in processing (Read 836 times)
Using java.util.List in processing
Jan 20th, 2010, 9:06am
 
Hello, i started to learn processing recently and i'm having trouble using java.util.List.

When i declare a List of objects as global variable, e.g. List<Type> MyList, i receive the following sentence on a method's line when compiling: unexpected token void.

Am i doing something wrong or it's not possible to use List in processing?

Im using the following statement, using a class named Corpos:

import java.util.*;
<Corpo> Corpos;
void setup()
{
  Corpos = new ArrayList<Corpo>();
}


Thank you.
Re: Using java.util.List in processing
Reply #1 - Jan 20th, 2010, 9:54am
 
I don't think templates are supported in processing.


EDIT: here is the reason: http://dev.processing.org/bugs/show_bug.cgi?id=598
Re: Using java.util.List in processing
Reply #2 - Jan 22nd, 2010, 5:35am
 
Thank you.

Now i see that i cant use the sintax ArrayList<type>, the grammar needs to be updated.

Page Index Toggle Pages: 1