Package ptolemy.data

Examples of ptolemy.data.IntToken.intValue()


                _throwable = null;
            }
        } else if (attribute == maxOutputLength) {
            IntToken length = (IntToken) maxOutputLength.getToken();

            if (length.intValue() > 0) {
                _outputLength = length.intValue();
            } else {
                throw new IllegalActionException(this,
                        "output array length is less than or equal 0?!");
            }
View Full Code Here


            }
        } else if (attribute == maxOutputLength) {
            IntToken length = (IntToken) maxOutputLength.getToken();

            if (length.intValue() > 0) {
                _outputLength = length.intValue();
            } else {
                throw new IllegalActionException(this,
                        "output array length is less than or equal 0?!");
            }
        } else {
View Full Code Here

        super.fire();

        int rate = ((IntToken) numberOfBits.getToken()).intValue();
        BooleanToken[] bits = new BooleanToken[rate];
        IntToken token = (IntToken) (input.get(0));
        int integer = token.intValue();

        if (integer < 0) {
            if (integer < -(1 << (rate - 1))) {
                throw new IllegalActionException(this,
                        "integer is out of range.");
View Full Code Here

        /** Return the current iteration count of this firing.
         */
        public int getIterationCount() {
            try {
                IntToken token = (IntToken) _evaluateExpressionInModelScope(_parseTree);
                _debug("firing " + getActor() + " " + token.intValue()
                        + " times");
                return token.intValue();
            } catch (Exception ex) {
                // FIXME: this isn't very nice.
                throw new RuntimeException(
View Full Code Here

        public int getIterationCount() {
            try {
                IntToken token = (IntToken) _evaluateExpressionInModelScope(_parseTree);
                _debug("firing " + getActor() + " " + token.intValue()
                        + " times");
                return token.intValue();
            } catch (Exception ex) {
                // FIXME: this isn't very nice.
                throw new RuntimeException(
                        "Error evaluating parse tree for expression" + ": "
                                + expression(), ex);
View Full Code Here

     */
    public void attributeChanged(Attribute attribute)
            throws IllegalActionException {
        if (attribute == interpolation) {
            IntToken token = (IntToken) (interpolation.getToken());
            _interpolationValue = token.intValue();

            if (_interpolationValue <= 0) {
                throw new IllegalActionException(this,
                        "Invalid interpolation: " + _interpolationValue
                                + ". Must be positive.");
View Full Code Here

            }

            _reinitializeNeeded = true;
        } else if (attribute == decimation) {
            IntToken token = (IntToken) (decimation.getToken());
            _decimationValue = token.intValue();

            if (_decimationValue <= 0) {
                throw new IllegalActionException(this, "Invalid decimation: "
                        + _decimationValue + ". Must be positive.");
            }
View Full Code Here

            }

            _reinitializeNeeded = true;
        } else if (attribute == decimationPhase) {
            IntToken token = (IntToken) (decimationPhase.getToken());
            _decimationPhaseValue = token.intValue();

            if (_decimationPhaseValue < 0) {
                throw new IllegalActionException(this,
                        "Invalid decimationPhase: " + _decimationPhaseValue
                                + ". Must be nonnegative.");
View Full Code Here

        /** Return the current iteration count of this symbolic schedule.
         */
        public int getIterationCount() {
            try {
                IntToken token = (IntToken) _evaluateExpressionInModelScope(_parseTree);
                return token.intValue();
            } catch (Exception ex) {
                // FIXME: this isn't very nice.
                throw new RuntimeException(
                        "Error evaluating parse tree for expression" + ": "
                                + expression(), ex);
View Full Code Here

        try {
            IntToken token = (IntToken) getToken();
            int value = _defaultValue;

            if (token != null) {
                value = token.intValue();
            }


            // Need to assign unique values.
            if (!isSuppressingPropagation()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.