Skip to main content
aboutsummaryrefslogblamecommitdiffstats
blob: 13597e0fd7ac5628e2257cd23c528d3b4754bf7c (plain) (tree)





















                                                        
@namespace(uri="DirectedGraph", prefix="DirectedGraph")
package DirectedGraph;

class Graph {
  val GraphElement[*]#graph contents;
}

abstract class GraphElement {
  ref Graph#contents graph;
}

class Node extends GraphElement {
  attr String label;
  ref Edge[*]#source outgoing;
  ref Edge[*]#target incoming;
}

class Edge extends GraphElement {
  attr Integer weight;
  ref Node#outgoing source;
  ref Node#incoming target;
}

Back to the top