001 // GraphLab Project: http://graphlab.sharif.edu 002 // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology 003 // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/ 004 005 package graphlab.plugins.reports.basicreports; 006 007 import graphlab.platform.lang.CommandAttitude; 008 import graphlab.plugins.main.GraphData; 009 import graphlab.plugins.main.core.AlgorithmUtils; 010 import graphlab.plugins.reports.extension.GraphReportExtension; 011 012 import java.util.ArrayList; 013 import java.util.Collections; 014 015 016 /** 017 * @author Mohammad Ali Rostami 018 */ 019 020 @CommandAttitude(name = "vertices_degree_list", abbreviation = "_vdl") 021 public class VerticesDegreesList implements GraphReportExtension { 022 public Object calculate(GraphData gd) { 023 ArrayList<Integer> al = AlgorithmUtils.getDegreesList(gd.getGraph()); 024 Collections.sort(al); 025 return al; 026 } 027 028 public String getName() { 029 return "Vertices Degrees List"; 030 } 031 032 public String getDescription() { 033 return "vertices degrees list"; 034 } 035 }