How do I turn a text line of integers into an array of integers?
<p>I have a text file in which half the lines are names and every other line is a series of integers separated by spaces:</p>

<pre><code>Jill

5 0 0 0

Suave

5 5 0 0

Mike

5 -5 0 0

Taj

3 3 5 0
</code></pre>

<p>I've successfully turned the names into an arraylist of strings, but I'd like to be able to read every other line and turn it into an arraylist of integers and then make an arraylist of those array lists. Here's what I have. I feel that it should work, but obviously I'm not doing something right because nothing populates my array list of integers.</p>

<p>rtemp is an arraylist of a single line of integers. allratings is the arraylist of arraylists.</p>

<pre><code>while (input.hasNext())
        {

            count++;

            String line = input.nextLine(); 
            //System.out.println(line);

            if (count % 2 == 1) //for every other line, reads the name
            {
                    names.add(line); //puts name into array
            }

            if (count % 2 == 0) //for every other line, reads the ratings
            {
                while (input.hasNextInt())
                {
                    int tempInt = input.nextInt();
                    rtemp.add(tempInt);
                    System.out.print(rtemp);
                }

                allratings.add(rtemp);  
            }

        }
</code></pre>
