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