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    
015    
016    @CommandAttitude(name = "num_of_edges", abbreviation = "_esize")
017    public class NumOfEdges implements GraphReportExtension<Integer> {
018        public String getName() {
019            return "Number of Edges";
020        }
021    
022        public String getDescription() {
023            return "Number of edges in the Graph";
024        }
025    
026        public Integer calculate(GraphData gd) {
027            return gd.getGraph().getEdgesCount();
028        }
029    }