View Single Post
  #5   Spotlight this post!  
Unread 18-02-2010, 22:28
Lord_Jeremy's Avatar
Lord_Jeremy Lord_Jeremy is offline
Lord_Jeremy the Procrastinator
AKA: Jeremy Agostino
FRC #1546 (Chaos Inc.)
Team Role: Electrical
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Baldwin, New York
Posts: 45
Lord_Jeremy is an unknown quantity at this point
Send a message via ICQ to Lord_Jeremy Send a message via AIM to Lord_Jeremy Send a message via MSN to Lord_Jeremy Send a message via Yahoo to Lord_Jeremy
Re: Trig Problem, missing arc functions?

It couldn't possibly have ArrayLists like you might be used to because this version of java doesn't support template classes. That means you can't do Class<Type>. You can use a Vector just like an ArrayList if you cast the return of elementAt(int) as the class you're expecting.

For example, the following code sets an array of doubles and then prints each value increased by 10.

Code:
import java.util.Vector;

public class Test
{
	public static void main(String[] args)
	{
		Vector vec = new Vector();
		
		vec.addElement( new Double( 1.0 ) );
		vec.addElement( new Double( -5.0 ) );
		vec.addElement( new Double( 2.2 ) );

		for( int i = 0; i < vec.size(); i++ )
		{
			System.out.println( 10 + ( (Double)vec.elementAt(i) ).doubleValue() );
		}
	}
}
__________________
Compiling...
Compiling...
Reply With Quote