Ejemplo n.º 1
0
  private void init(Actor alg, Class type, String id) {
    _algorithm = alg;
    _type = type;
    _id = id;

    alg.registerInput(this);
  }
Ejemplo n.º 2
0
  /**
   * Provide an instance of the type of data this InputPort should receive, as well as an ID for
   * this InputPort
   *
   * @param sampleData not null
   * @param id not null
   */
  public InputPort(Actor alg, Class<? super TT> type, String id) {
    if (alg == null || type == null || id == null || Actor.getInput(id) != null) {
      throw new IllegalArgumentException(
          "Algorithm, type and id not allowed to be null, and id must be unique.");
    }

    init(alg, type, id);
  }