Ejemplo n.º 1
0
  /** Load all the data. */
  public static void init(Resolver loader, String file) {
    if (initialized) return;

    inclGraph = new SimpleDirectedGraph<GraphClass, Inclusion>(Inclusion.class);
    problems = new Vector<Problem>();
    load(loader, file, inclGraph, problems);

    // Sort problems
    Collections.sort(
        problems,
        new Comparator<Problem>() {
          public int compare(Problem o1, Problem o2) {
            return o1.getName().compareTo(o2.getName());
          }
        });

    // Gather the classnames
    names = new TreeMap<String, GraphClass>(new LessLatex());
    for (GraphClass gclass : inclGraph.vertexSet()) names.put(gclass.toString(), gclass);

    // Gather the SCCs
    sccs = GAlg.calcSCCMap(inclGraph);

    initialized = true;
  }
Ejemplo n.º 2
0
 /** Returns the nodes of the available graphclasses ordered alphabetically. */
 public static Collection<GraphClass> getClasses() {
   return Collections.unmodifiableCollection(names.values());
 }
Ejemplo n.º 3
0
 /** Returns the names of the available graphclasses ordered alphabetically. */
 public static Set<String> getClassNames() {
   return Collections.unmodifiableSet(names.keySet());
 }
Ejemplo n.º 4
0
 /** Return the node in inclGraph belonging to the given classname. */
 public static GraphClass getClass(String name) {
   return names.get(name);
 }