/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sidnet.utilityviews.statscollector;

import sidnet.core.misc.Node;

/**
 *
 * @author Oliver
 */
public class StatEntry_MaximumNeighborsCount extends StatEntry{
    private int maximumNeighborsCount = 0;

    public StatEntry_MaximumNeighborsCount() {
        this("MaximumNeighborsCount"); // default header
    }

    public StatEntry_MaximumNeighborsCount(String customHeader)
    {
        super(customHeader);
    }
            
    
    /**
     * @inheridoc
     */
    public String getValueAsString()
    {
        return "" + maximumNeighborsCount;
    }
    
    /**
     * @inheridoc
     */
   public void update(Node[] nodes)
   {
       maximumNeighborsCount = 0;
       for (int i = 0; i < nodes.length; i++)
           if (maximumNeighborsCount < nodes[i].neighboursList.size())
                maximumNeighborsCount = nodes[i].neighboursList.size();
   }

}
