Package ptolemy.data

Examples of ptolemy.data.BooleanToken


     boolean.
     */
    public boolean evaluateBoolean(String expression)
            throws PtalonRuntimeException {
        try {
            BooleanToken result = (BooleanToken) evaluateExpression(expression);
            return result.booleanValue();
        } catch (ClassCastException ex) {
            throw new PtalonRuntimeException("Not a boolean token.");
        }
    }
View Full Code Here


     *  parameter.
     *  @exception IllegalActionException If there is no director.
     */
    public void fire() throws IllegalActionException {
        super.fire();
        BooleanToken inputToken = (BooleanToken) input.get(0);

        if (inputToken.booleanValue()) {
            output.send(0, trueValue.getToken());
        } else {
            output.send(0, falseValue.getToken());
        }
    }
View Full Code Here

                // generate code for reinitialization if reset is
                // true.  we assume the value of reset itself cannot
                // be changed dynamically

                BooleanToken resetToken = (BooleanToken) transition.reset
                        .getToken();
                if (resetToken.booleanValue()) {
                    actors = destinationState.getRefinement();

                    if (actors != null) {
                        for (int i = 0; i < actors.length; ++i) {
                            ActorCodeGenerator helper = (ActorCodeGenerator) _getHelper((NamedObj) actors[i]);
View Full Code Here

    LOGGER = LoggerFactory.getLogger(container.getClass().getName() + "." + this.getClass().getName());

    if (container.getAttribute(MOCKMODE_PARAM) != null) {
      mockModeParam = (Parameter) container.getAttribute(MOCKMODE_PARAM);
    } else {
      mockModeParam = new Parameter(container, MOCKMODE_PARAM, new BooleanToken(false));
      mockModeParam.setTypeEquals(BaseType.BOOLEAN);
      new CheckBoxStyle(mockModeParam, "style");
      registerConfigurableParameter(mockModeParam);
    }

    if (container.getAttribute(EXPERTMODE_PARAM) != null) {
      expertModeParam = (Parameter) container.getAttribute(EXPERTMODE_PARAM);
    } else {
      expertModeParam = new Parameter(container, EXPERTMODE_PARAM, new BooleanToken(false));
      expertModeParam.setTypeEquals(BaseType.BOOLEAN);
      new CheckBoxStyle(expertModeParam, "style");
      registerConfigurableParameter(expertModeParam);
    }

    if (container.getAttribute(VALIDATE_INITIALIZATION_PARAM) != null) {
      validateInitializationParam = (Parameter) container.getAttribute(VALIDATE_INITIALIZATION_PARAM);
    } else {
      validateInitializationParam = new Parameter(container, VALIDATE_INITIALIZATION_PARAM, new BooleanToken(true));
      validateInitializationParam.setTypeEquals(BaseType.BOOLEAN);
      new CheckBoxStyle(validateInitializationParam, "style");
      registerConfigurableParameter(validateInitializationParam);
    }

    if (container.getAttribute(VALIDATE_ITERATION_PARAM) != null) {
      validateIterationParam = (Parameter) container.getAttribute(VALIDATE_ITERATION_PARAM);
    } else {
      validateIterationParam = new Parameter(container, VALIDATE_ITERATION_PARAM, new BooleanToken(false));
      validateIterationParam.setTypeEquals(BaseType.BOOLEAN);
      new CheckBoxStyle(validateIterationParam, "style");
      registerConfigurableParameter(validateIterationParam);
    }
  }
View Full Code Here

TOP

Related Classes of ptolemy.data.BooleanToken

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.