fr.ocelet.runtime.relation
Class RegularOgraph

Package class diagram package RegularOgraph
java.lang.Object
  extended by fr.ocelet.runtime.relation.Graph
      extended by fr.ocelet.runtime.relation.RegularOgraph

public class RegularOgraph
extends Graph

Regular graph implementation. We call a graph regular if its edges connect two vertex (and only two). In other words, a regular graph is not a hypergraph.


Field Summary
protected  edu.uci.ics.jung.graph.DirectedSparseMultigraph<Role,Edge> dsmg
           
 
Fields inherited from class fr.ocelet.runtime.relation.Graph
edgeCounter
 
Constructor Summary
protected RegularOgraph()
          Protected constructor
 
Method Summary
<T extends java.util.Collection<Entity>>
void
addEdge(T vcol)
          Adds an edge to the graph, linking all together all the entities provided in the argument Collection.
 void applyInteraction(Interaction gi)
          Applies the given interaction to every edge of the graph.
 Edge getNewEdge()
          Obtains a new Edge instance for this graph.
<T extends java.util.Collection<Entity>>
void
removeEdge(T vcol)
          Removes from the graph the edge linking together the entities present in the argument Collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dsmg

protected edu.uci.ics.jung.graph.DirectedSparseMultigraph<Role,Edge> dsmg
Constructor Detail

RegularOgraph

protected RegularOgraph()
Protected constructor

Method Detail

addEdge

public <T extends java.util.Collection<Entity>> void addEdge(T vcol)
Adds an edge to the graph, linking all together all the entities provided in the argument Collection.

Specified by:
addEdge in class Graph
Parameters:
vcol - A Collection of entities that will be added as vertex to the graph and linked to each other by one edge.

removeEdge

public <T extends java.util.Collection<Entity>> void removeEdge(T vcol)
Removes from the graph the edge linking together the entities present in the argument Collection.

Specified by:
removeEdge in class Graph
Parameters:
vcol - A collection of entities.

applyInteraction

public void applyInteraction(Interaction gi)
Applies the given interaction to every edge of the graph. This operation behaves like if the interaction was applied in parallel on all the edges of the graph at the same time.

Specified by:
applyInteraction in class Graph
Parameters:
gi - The Interaction operation to apply.

getNewEdge

public Edge getNewEdge()
Obtains a new Edge instance for this graph. This gives a possibility for subclasses to provide their own type of Edge. Obtaining an Edge instance does not add an edge to the graph. Adding an edge to the graph can be done through the connect() method.

Specified by:
getNewEdge in class Graph
Returns:
An Edge