Changeset View
Changeset View
Standalone View
Standalone View
java/server/src/main/java/org/softwareheritage/graph/algo/Stats.java
package org.softwareheritage.graph.algo; | package org.softwareheritage.graph.algo; | ||||
import java.io.FileInputStream; | import java.io.FileInputStream; | ||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.util.Properties; | import java.util.Properties; | ||||
/** | /** | ||||
* Statistics on the compressed graph. | * Statistics on the compressed graph. | ||||
* <p> | |||||
* These statistics are not computed but directly read from <a | |||||
* href="http://webgraph.di.unimi.it/">WebGraph</a> generated .stats and .properties files. | |||||
* | * | ||||
* @author Thibault Allançon | * @author Thibault Allançon | ||||
* @version 0.0.1 | * @version 0.0.1 | ||||
* @since 0.0.1 | * @since 0.0.1 | ||||
*/ | */ | ||||
public class Stats { | public class Stats { | ||||
public class Counts { | public class Counts { | ||||
Show All 17 Lines | public class Stats { | ||||
public Counts counts; | public Counts counts; | ||||
public Ratios ratios; | public Ratios ratios; | ||||
public Degree indegree; | public Degree indegree; | ||||
public Degree outdegree; | public Degree outdegree; | ||||
/** | /** | ||||
* Constructor. | * Constructor. | ||||
* | * | ||||
* @param graphPath full path of compressed graph | * @param graphPath path and basename of compressed graph | ||||
*/ | */ | ||||
public Stats(String graphPath) throws IOException { | public Stats(String graphPath) throws IOException { | ||||
Properties properties = new Properties(); | Properties properties = new Properties(); | ||||
properties.load(new FileInputStream(graphPath + ".properties")); | properties.load(new FileInputStream(graphPath + ".properties")); | ||||
properties.load(new FileInputStream(graphPath + ".stats")); | properties.load(new FileInputStream(graphPath + ".stats")); | ||||
this.counts = new Counts(); | this.counts = new Counts(); | ||||
this.ratios = new Ratios(); | this.ratios = new Ratios(); | ||||
Show All 17 Lines |