示例#1
0
  public void addEdge(Course source, Course target) {

    if (this.edges.containsKey(source.getName())) {
      this.edges.get(source.getName()).put(target.getName(), target);
    } else {
      this.edges.put(source.getName(), new HashMap<String, Course>());
      this.edges.get(source.getName()).put(target.getName(), target);
    }
  }
示例#2
0
  public void addNode(Course course) {

    if (!this.nodes.containsKey(course.getName())) {
      this.nodes.put(course.getName(), course);
    }
  }