示例#1
0
 /**
  * Instructs the <code>Project</code> that one <code>Builder</code> depends on the other. Both
  * <code>Builder</code> instances must first be added to this <code>Project</code>.
  *
  * <p><code>builder1</code> depends on <code>builder2</code>.
  *
  * @param builder1 A <code>Builder</code>. This <code>Builder</code> depends on the other.
  * @param builder2 A <code>Builder</code>.
  */
 public void dependsOn(Builder builder1, Builder builder2) {
   String head = Integer.toString(builder1.hashCode()),
       tail = Integer.toString(builder2.hashCode());
   if (!head.equals(tail)
       && dependencies.containsKey(head)
       && dependencies.containsKey(tail)
       && !dependencies.dependencyExists(head, tail)) {
     dependencies.addDependency(head, tail);
   }
 }
示例#2
0
  /**
   * Adds an <code>Application</code> or a <code>Library</code> to the <code>Project</code>.
   *
   * @param builder An instance of the <code>Application</code> or a <code>Library</code> class.
   */
  public void addBuilder(Builder builder) {
    String name = Integer.toString(builder.hashCode());
    dependencies.put(name, builder);

    if (!dependencies.containsVertex(name)) {
      dependencies.addVertex(new Vertex<String, Builder>(name));
    }
  }
示例#3
0
 /**
  * Removes an <code>Application</code> or a <code>Library</code> from the <code>Project</code>.
  *
  * @param builder An instance of the <code>Application</code> or a <code>Library</code> class.
  */
 public void removeBuilder(Builder builder) {
   String name = Integer.toString(builder.hashCode());
   dependencies.remove(name);
   dependencies.removeVertex(name);
 }