/*
 * 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_MinimumNeighborsCount extends StatEntry{
    private int minimumNeighborsCount = 0;

    public StatEntry_MinimumNeighborsCount() {
        this("MinimumNeighborsCount"); // default header
    }

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

}
