org.graphstream.algorithm.measure
Class AbstractCentrality

java.lang.Object
  extended by org.graphstream.algorithm.measure.AbstractCentrality
All Implemented Interfaces:
Algorithm
Direct Known Subclasses:
ClosenessCentrality, DegreeCentrality, EigenvectorCentrality

public abstract class AbstractCentrality
extends Object
implements Algorithm

Base class for centrality measures. Subclasses should implements a computeCentrality() method where centrality values will be stored in data.


Nested Class Summary
static class AbstractCentrality.NormalizationMode
           
 
Method Summary
 void compute()
          Run the algorithm.
 void copyValuesTo(String attribute)
          Copy values previously computed to a specific attribute.
 void copyValuesTo(String attribute, AbstractCentrality.NormalizationMode normalize)
          Copy values previously computed to a specific attribute.
 String getCentralityAttribute()
          Getter for centralityAttribute.
 AbstractCentrality.NormalizationMode getNormalizationMode()
          Getter for normalize.
 void init(org.graphstream.graph.Graph graph)
          Initialization of the algorithm.
 void setCentralityAttribute(String centralityAttribute)
          Setter for centralityAttribute.
 void setNormalizationMode(AbstractCentrality.NormalizationMode normalize)
          Setter for normalize.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public void init(org.graphstream.graph.Graph graph)
Description copied from interface: Algorithm
Initialization of the algorithm. This method has to be called before the Algorithm.compute() method to initialize or reset the algorithm according to the new given graph.

Specified by:
init in interface Algorithm
Parameters:
graph - The graph this algorithm is using.

compute

public void compute()
Description copied from interface: Algorithm
Run the algorithm. The Algorithm.init(Graph) method has to be called before computing.

Specified by:
compute in interface Algorithm
See Also:
Algorithm.init(Graph)

copyValuesTo

public void copyValuesTo(String attribute)
Copy values previously computed to a specific attribute. The compute() method needs to have been call before calling this one.

Parameters:
attribute - destination attribute where values of centrality will be stored

copyValuesTo

public void copyValuesTo(String attribute,
                         AbstractCentrality.NormalizationMode normalize)
Copy values previously computed to a specific attribute. The compute() method needs to have been call before calling this one.

Parameters:
attribute - destination attribute where values of centrality will be stored
normalize - defines the way that values have to be normalized

getCentralityAttribute

public String getCentralityAttribute()
Getter for centralityAttribute.

Returns:
centralityAttribute

setCentralityAttribute

public void setCentralityAttribute(String centralityAttribute)
Setter for centralityAttribute.

Parameters:
centralityAttribute - new value of centralityAttribute

getNormalizationMode

public AbstractCentrality.NormalizationMode getNormalizationMode()
Getter for normalize.

Returns:
normalize

setNormalizationMode

public void setNormalizationMode(AbstractCentrality.NormalizationMode normalize)
Setter for normalize.

Parameters:
normalize - new value of normalize


Copyright © 2013. All Rights Reserved.