Search in sources :

Example 1 with LabelRuleComparator

use of fr.lirmm.graphik.graal.core.LabelRuleComparator in project graal by graphik-team.

the class DefaultGraphOfRuleDependencies method toString.

// /////////////////////////////////////////////////////////////////////////
// OVERRIDE METHODS
@Override
public String toString() {
    StringBuilder s = new StringBuilder();
    TreeSet<Rule> rules = new TreeSet<Rule>(new LabelRuleComparator());
    for (Rule r : this.graph.vertexSet()) {
        rules.add(r);
    }
    for (Rule src : rules) {
        for (Integer e : this.graph.outgoingEdgesOf(src)) {
            Rule dest = this.graph.getEdgeTarget(e);
            s.append(src.getLabel());
            s.append(" -");
            if (this.computingUnifiers) {
                for (Substitution sub : this.edgesValue.get(this.graph.getEdge(src, dest))) {
                    s.append(sub);
                }
            }
            s.append("-> ");
            s.append(dest.getLabel());
            s.append('\n');
        }
    }
    return s.toString();
}
Also used : LabelRuleComparator(fr.lirmm.graphik.graal.core.LabelRuleComparator) Substitution(fr.lirmm.graphik.graal.api.core.Substitution) TreeSet(java.util.TreeSet) Rule(fr.lirmm.graphik.graal.api.core.Rule)

Aggregations

Rule (fr.lirmm.graphik.graal.api.core.Rule)1 Substitution (fr.lirmm.graphik.graal.api.core.Substitution)1 LabelRuleComparator (fr.lirmm.graphik.graal.core.LabelRuleComparator)1 TreeSet (java.util.TreeSet)1