de.ipk_gatersleben.ag_nw.centilib.centralities
Class VertexCentrality<V,E>

java.lang.Object
  extended by de.ipk_gatersleben.ag_nw.centilib.centralities.VertexCentrality<V,E>
Type Parameters:
V - Type of nodes
E - Type of edges
All Implemented Interfaces:
VertexScorer<V,Double>

public abstract class VertexCentrality<V,E>
extends Object
implements VertexScorer<V,Double>

This abstract class implements the interface VertexScorer and adds some methods for accessing the name, graph and average centrality value.

Author:
Johannes Graessler

Field Summary
protected  Double average
           
protected  Graph<V,E> graph
           
protected  String name
           
protected  Map<V,Double> output
           
 
Constructor Summary
VertexCentrality(String name, Graph<V,E> graph)
          Create an instance for the given graph.
 
Method Summary
 Double getAverageValue()
          Returns the average value of this centrality if possible.
 Graph<V,E> getGraph()
          Returns the graph, this centrality is computed for.
 String getName()
          Returns the name of this centrality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.uci.ics.jung.algorithms.scoring.VertexScorer
getVertexScore
 

Field Detail

name

protected String name

output

protected Map<V,Double> output

graph

protected Graph<V,E> graph

average

protected Double average
Constructor Detail

VertexCentrality

public VertexCentrality(String name,
                        Graph<V,E> graph)
Create an instance for the given graph.

Parameters:
name - The name of the centrality.
graph - The graph this centrality is computed for.
Method Detail

getName

public String getName()
Returns the name of this centrality.

Returns:
the name of the centrality.

getGraph

public Graph<V,E> getGraph()
Returns the graph, this centrality is computed for.

Returns:
the graph this centrality is computed for.

getAverageValue

public Double getAverageValue()
Returns the average value of this centrality if possible. If the values were not computed yet or there are some values missing Double.NaN is returned.

Returns:
the average value or Double.NaN