For Loop with doubles and arrays and Lists
<p>What is the correct syntax to iterate through an array of doubles and add the weights to the values List?  The following fails, I've tried all types of combinations but the correct one?</p>

<pre><code>private double[] weightArray =new double[] {200,215,220,215,200};

  List&lt;double[]&gt; values = new ArrayList&lt;double[]&gt;();

  for (int i = 0; i &lt; weightArray.length; i++) {  // i indexes each element successively.
    values.addAll(new double[] weightArray[i]);     
}
</code></pre>

<p>TIA</p>

<p>Here is an edit and some additional information.  I appreciate all of the answers, my apologies for not clearly stating the question.   Below is working code.  (Android chart rendering...)</p>

<pre><code>  List&lt;double[]&gt; values = new ArrayList&lt;double[]&gt;();

values.add(new double[] {15,15,13,16.8,20.4,24.4,26.4,26.1,23.6,20.3 });
values.add(new double[] { 10, 10, 12, 15, 20, 24, 26, 26, 23, 18 });
values.add(new double[] { 5, 5.3, 8, 12, 17, 22, 24.2, 24, 19, 15 });
values.add(new double[] { 5, 5, 5, 5, 19, 23, 26, 25, 22, 18});
</code></pre>

<p>I want to load these values from a database.   They are hard coded in my example. How do I fill the required arrays with numbers?  i.e.  How do you fill the values.add method using either a for loop or a foreach loop?  </p>

<p>The values List is used in the following signature:</p>

<pre><code>Intent intent = ChartFactory.getLineChartIntent(context, buildDataset(titles, x, values),
    renderer, "Test Chart");
</code></pre>

<p>TIA</p>
