de.ipk_gatersleben.ag_nw.centilib.plugin
Interface CentiLibInteractions<G,V,E>

Type Parameters:
G - Type of the graphs
V - Type of the nodes
E - Type of the edges

public interface CentiLibInteractions<G,V,E>

This Interface is used to get informations from and interact with unknown data structures that work with graphs. For example, it is used by the CentiLib GUI to access the data structures of the tool it is integrated into.

Author:
Johannes Graessler

Method Summary
 boolean addCentralityAttribute(V node, String centName, Double value)
          Adds the attribute centName to node and sets the value 'value'
 G createSubGraph(G graph, Set<V> nodes, Set<E> edges, String name)
          Creates a subgraph of 'graph' that contains the given nodes and edges.
 void deleteCentralityAttribute(V node, String centName)
          Deletes the attribute centName from node if it exists
 G getCurrentGraph()
          Returns the currently selected graph.
 Set<G> getGraphs()
          Returns all available graphs
 Set<DoubleAttribute<E>> getNumericEdgeAttributes(G graph)
          Returns a set of edge attributes for graph that contain numbers or double values respectively
 Set<DoubleAttribute<V>> getNumericNodeAttributes(G graph)
          Returns a set of node attributes for graph that contain numbers or double values respectively
 Graph<V,E> getWrapper(G graph)
          Returns an instance that wraps graph to fit the Interface 'Graph'
 void selectGraph(G graph)
          Sets 'graph' as current graph and brings the corresponding view into focus (if one exists)
 void selectNodesOfCurrentGraph(Set<V> nodes)
          Selects all nodes in the currently selected graph view which are contained in the set 'nodes'.
 

Method Detail

getNumericEdgeAttributes

Set<DoubleAttribute<E>> getNumericEdgeAttributes(G graph)
Returns a set of edge attributes for graph that contain numbers or double values respectively

Parameters:
graph - The graph whose edge attributes shall be returned
Returns:
a set of edge attributes that contain numbers

getNumericNodeAttributes

Set<DoubleAttribute<V>> getNumericNodeAttributes(G graph)
Returns a set of node attributes for graph that contain numbers or double values respectively

Parameters:
graph - The graph whose node attributes shall be returned
Returns:
a set of node attributes that contain numbers

getGraphs

Set<G> getGraphs()
Returns all available graphs

Returns:
a set of available graphs

getCurrentGraph

G getCurrentGraph()
Returns the currently selected graph.

Returns:
the currently selected graph

getWrapper

Graph<V,E> getWrapper(G graph)
Returns an instance that wraps graph to fit the Interface 'Graph'

Parameters:
graph - the graph to be wrapped
Returns:
an instance that wraps graph and implements Graph

selectNodesOfCurrentGraph

void selectNodesOfCurrentGraph(Set<V> nodes)
Selects all nodes in the currently selected graph view which are contained in the set 'nodes'.

Parameters:
nodes - The nodes to select.

selectGraph

void selectGraph(G graph)
Sets 'graph' as current graph and brings the corresponding view into focus (if one exists)

Parameters:
graph - The graph to select.

addCentralityAttribute

boolean addCentralityAttribute(V node,
                               String centName,
                               Double value)
Adds the attribute centName to node and sets the value 'value'

Parameters:
node - the node to add the attribute to
centName - the name of the attribute (centrality)
value - the value of the added attribute
Returns:
true if the attribute was added and the value set, false otherwise

deleteCentralityAttribute

void deleteCentralityAttribute(V node,
                               String centName)
Deletes the attribute centName from node if it exists

Parameters:
node - the node to delete the attribute from
centName - the name of the attribute

createSubGraph

G createSubGraph(G graph,
                 Set<V> nodes,
                 Set<E> edges,
                 String name)
Creates a subgraph of 'graph' that contains the given nodes and edges. The nodes of the subgraph should be exact copies of the original ones. This way the visual presentation of the nodes and their attributes are retained.

Parameters:
graph - original graph
nodes - set of nodes of the original graph which are to be copied to the subgraph
edges - set of edges of the original graph which are to be copied to the subgraph
name - the name of the subgraph
Returns:
the newly created graph