Q:

standard deviation arraylist error

I am getting an error when I try to retrieve the individual values to find the variance in the process of calculating the standard deviation. I can't figure out whether to use .get() or .getValue and I am lost. I have already calculated the average. 
final ArrayList<Map.Entry<String,NumberHolder>> entries = new ArrayList<Map.Entry<String,NumberHolder>>(uaCount.entrySet());

for(Map.Entry<String,NumberHolder> entry : entries)  //iterating over the sorted hashmap
{

    double temp = 0;
    double variance = 0;

    for (int i = 0; i <= entry.getValue().occurrences ; i ++)
        {               
            temp += ((entry.getValue(i).singleValues) - average)*((entry.getValue(i).singleValues) - average);

            variance = temp/entry.getValue().occurrences;
        }

        double stdDev = Math.sqrt(variance);

This is my NumberHolder class, which I populate in my main funcion. I am using this equation for standard deviation: http://www.mathsisfun.com/data/standard-deviation-formulas.html
based on my code, occurrences is N and the values from the singleValues arraylist are Xi
public static class NumberHolder
{
    public int occurrences = 0;
    public int sumtime_in_milliseconds = 0; 
    public ArrayList<Long> singleValues = new ArrayList<Long>();
}

This is the error I get. : 
The method getValue() in the type Map.Entry<String,series3.NumberHolder> is not applicable for the arguments (int). 

If you need to see more code please just ask, I didn't want to put anything unnecessary but I might have missed something. 

A:

You can't take int as argument in Map.Entry#getValue(). So in your code it should be entry.getValue() instead of entry.getValue(i). Now apart from this your singleValues is an ArrayList . so you can't subtract it from integer average in line (entry.getValue(i).singleValues) - average). You have to first extract out the element from the ArrayList and then subtract it from the average. Your for loop should be something like this:
for (int i = 0; i < entry.getValue().occurrences ; i ++)// i < entry.getValue() to avoid IndexOutOfBoundsException
{               
   temp += ((entry.getValue().singleValues.get(i)) - average)*((entry.getValue().singleValues.get(i)) - average);
   variance = temp/entry.getValue().occurrences;
}

