de.cesr.more.measures.node
Class MNodeMeasureManager

java.lang.Object
  extended by de.cesr.more.measures.MAbstractMeasureSupplier
      extended by de.cesr.more.measures.MAbstractMeasureManager
          extended by de.cesr.more.measures.node.MNodeMeasureManager
All Implemented Interfaces:
MMeasureSelectorListener, MoreMeasureSupplier

public class MNodeMeasureManager
extends MAbstractMeasureManager

The NetworkMeasureUtilites manage network measure calculation. NetworkMeasureSuppliers are registered here. This class also implements the MMeasureSelectorListener interface for adding measures for computation via the MeasureChooser. It holds all scheduled actions that calculate measures.

Date:
23.05.2008

Field Summary
protected static MNodeMeasureManager instance
           
 
Fields inherited from class de.cesr.more.measures.MAbstractMeasureManager
listeners, measureActions, promptForMeasureParameters
 
Fields inherited from class de.cesr.more.measures.MAbstractMeasureSupplier
categories, measures, suppliers
 
Method Summary
<T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>>
boolean
addMeasureCalculation(MoreNetwork<T,E> network, MMeasureDescription measureDesc, Map<String,Object> params)
          The Type of nodes in the given MoreNetwork needs to extend MoreNodeMeasureSupport since the MNodeMeasureManager requires access to methods that get and set measures at the node.
<T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>>
boolean
addMeasureCalculation(MoreNetwork<T,E> network, String shortname)
          Takes a short description instead of a MeasureDescription and uses default parameter map.
<T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>>
void
addMeasureCalculation(MoreNetwork<T,E> network, String shortname, Map<String,Object> params)
          Takes a short description instead of a MeasureDescription.
<T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>>
boolean
addMeasureCalculation(String network, MMeasureDescription measureDesc, Map<String,Object> params)
           
<T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>>
boolean
addMeasureCalculation(String network, String shortname, Map<String,Object> params)
          Takes a short description instead of a MeasureDescription.
static MNodeMeasureManager getInstance()
           
<T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>>
boolean
removeMeasureCalculation(MoreNetwork<T,E> network, MMeasureDescription key)
          Removes BasicAction that calculates the measure for the given network for the given measure key from the Schedule to stop computation of that measure.
<T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>>
boolean
removeMeasureCalculation(MoreNetwork<T,E> network, String key)
           
static void reset()
          Reset the static instance variable.
 boolean setMeasureBundle(MMeasureBundle bundle, boolean remove)
          This method is invoked every time the user selects a measure at the MeasureChooser
 
Methods inherited from class de.cesr.more.measures.MAbstractMeasureManager
addMeasureManagerListener, getAddableMeasures, getMeasureCalculations, getRemovableMeasures, isPromptForMeasureParameters, printLatexMeasureDescriptions, removeMeasureManagerListener, setPromptForMeasureParameters
 
Methods inherited from class de.cesr.more.measures.MAbstractMeasureSupplier
addMeasureSupplier, equals, findMeasure, getCategories, getMeasureDescriptions, hashCode, removeMeasureSupplier
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static MNodeMeasureManager instance
Method Detail

getInstance

public static MNodeMeasureManager getInstance()
Returns:
The current instance of NetworkMeasureUtilities.
Date:
15.08.2008

addMeasureCalculation

public <T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>> boolean addMeasureCalculation(MoreNetwork<T,E> network,
                                                                                                      MMeasureDescription measureDesc,
                                                                                                      Map<String,Object> params)
The Type of nodes in the given MoreNetwork needs to extend MoreNodeMeasureSupport since the MNodeMeasureManager requires access to methods that get and set measures at the node.

Type Parameters:
T - Type of nodes)
E - Edge type
Parameters:
network - the network to add the measure for
measureDesc - the measure description of the measure to add
params - parameter map of options for calculation
Returns:
true if adding the measure calculation was successful
Date:
26.11.2008

addMeasureCalculation

public <T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>> boolean addMeasureCalculation(String network,
                                                                                                      MMeasureDescription measureDesc,
                                                                                                      Map<String,Object> params)
Type Parameters:
T - agent type
E - edge type
Parameters:
network -
measureDesc - measure description to add
params - parameter map
Returns:
true if measure could be added
See Also:
MNodeMeasureManager#addMeasureCalculation(MoreNetwork, de.cesr.more.measures.MMeasureDescription, Map)

addMeasureCalculation

public <T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>> boolean addMeasureCalculation(MoreNetwork<T,E> network,
                                                                                                      String shortname)
Takes a short description instead of a MeasureDescription and uses default parameter map.

Type Parameters:
T - agent type
E - edge type
Parameters:
network -
measureDesc - measure description to add
Returns:
true if measure could be added
See Also:
MNodeMeasureManager#addMeasureCalculation(MoreNetwork, de.cesr.more.measures.MMeasureDescription, Map)

addMeasureCalculation

public <T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>> boolean addMeasureCalculation(String network,
                                                                                                      String shortname,
                                                                                                      Map<String,Object> params)
Takes a short description instead of a MeasureDescription.

See Also:
MNodeMeasureManager#addMeasureCalculation(MoreNetwork, de.cesr.more.measures.MMeasureDescription, Map)

removeMeasureCalculation

public <T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>> boolean removeMeasureCalculation(MoreNetwork<T,E> network,
                                                                                                         MMeasureDescription key)
Removes BasicAction that calculates the measure for the given network for the given measure key from the Schedule to stop computation of that measure. Furthermore its sets the associated measures at the node to Double.NaN or null respectively.

Type Parameters:
T - Type of elements in the given ContextContextContextJungNetwork that should implement NetworkMeasureSupport
Parameters:
network - The network the measure is associated with
key - The key for the measure to remove from calculation
Returns:
true, if there was a measure that could be removed
Date:
24.05.2008

removeMeasureCalculation

public <T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>> boolean removeMeasureCalculation(MoreNetwork<T,E> network,
                                                                                                         String key)
Type Parameters:
T - Type of elements in the given ContextContextContextJungNetwork that should implement NetworkMeasureSupport
Parameters:
network - The network the measure is associated with
key - The key for the measure to remove from calculation
Returns:
true, if there was a measure that could be removed
See Also:
removeMeasureCalculation(MoreNetwork, MMeasureDescription)

setMeasureBundle

public boolean setMeasureBundle(MMeasureBundle bundle,
                                boolean remove)
Description copied from interface: MMeasureSelectorListener
This method is invoked every time the user selects a measure at the MeasureChooser

Parameters:
bundle - the measure bundle that was selected
remove - true if the selected measure shall be removed from this collection
Returns:
true, if the measure could be set (and has not been existing before) or removed (and has been existing)
See Also:
edu.MMeasureSelectorListener.sh.soneta.gui.MeasureChooserListener#setMeasureBundle(edu.MMeasureBundle.sh.soneta.measures.MeasureBundle, boolean)

addMeasureCalculation

public <T extends MoreNodeMeasureSupport,E extends MoreEdge<? super T>> void addMeasureCalculation(MoreNetwork<T,E> network,
                                                                                                   String shortname,
                                                                                                   Map<String,Object> params)
Takes a short description instead of a MeasureDescription.

See Also:
MNodeMeasureManager#addMeasureCalculation(ContextContextJungNetwork, de.cesr.more.measures.node.MNodeMeasureManager.sh.soneta.measures.NetworkMeasureUtilities.MeasureDescription, Map)

reset

public static void reset()
Reset the static instance variable. Called by MManager.reset().