fr.ocelet.runtime.relation
Class Graph

Package class diagram package Graph
java.lang.Object
  extended by fr.ocelet.runtime.relation.Graph
Direct Known Subclasses:
HyperOgraph, RegularOgraph

public abstract class Graph
extends java.lang.Object

Generic abstract class that represents any kind of graph used in Ocelet


Field Summary
protected static long edgeCounter
           
 
Constructor Summary
Graph()
           
 
Method Summary
abstract
<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.
abstract  void applyInteraction(Interaction gi)
          Applies the given interaction to every edge of the graph.
abstract  Edge getNewEdge()
          Obtains a new Edge instance for this graph.
abstract
<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

edgeCounter

protected static long edgeCounter
Constructor Detail

Graph

public Graph()
Method Detail

getNewEdge

public abstract 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.

Returns:
An Edge

addEdge

public abstract <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.

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 abstract <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.

Parameters:
vcol - A collection of entities.

applyInteraction

public abstract 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.

Parameters:
gi - The Interaction operation to apply.