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 package graphlab.plugins.reports.basicreports; 005 006 import graphlab.platform.lang.CommandAttitude; 007 import graphlab.plugins.main.GraphData; 008 import graphlab.plugins.reports.extension.GraphReportExtension; 009 010 /** 011 * @author azin azadi 012 */ 013 014 @CommandAttitude(name = "num_of_vertices", abbreviation = "_vsize") 015 public class NumOfVertices implements GraphReportExtension { 016 public String getName() { 017 return "Number of Vertices"; 018 } 019 020 public String getDescription() { 021 return "Number of vertices in the Graph"; 022 } 023 024 public Object calculate(GraphData gd) { 025 return gd.getGraph().getVerticesCount(); 026 } 027 }