示例#1
0
 public boolean acceptInputPort(Port p) {
   if (p == null || p.getContainer() != this) {
     return false;
   }
   if (p instanceof ControlPort || !p.isInput()) {
     return false;
   }
   return PortMode.PUSH.equals(p.getMode());
 }
示例#2
0
  /** Create the second port needed by modulo function */
  private void _createSecondPort() throws NameDuplicationException, IllegalActionException {
    // Go looking for the port in case somebody else created the port
    // already. For example, this might
    // happen in shallow code generation.
    secondOperand = (Port) getPort("secondOperand");
    if (secondOperand == null) {
      secondOperand =
          PortFactory.getInstance().createInputPort(this, "secondOperand", Double.class);

    } else if (secondOperand.getContainer() == null) {
      secondOperand.setContainer(this);
    }
  }