Package ptolemy.data

Examples of ptolemy.data.BooleanToken.booleanValue()


        super.fire();
        $ASSIGN$_latestSum(_sum);
        for (int i = 0; i < reset.getWidth(); i++) {
            if (reset.hasToken(i)) {
                BooleanToken r = (BooleanToken)reset.get(i);
                if (r.booleanValue()) {
                    $ASSIGN$_latestSum(output.getType().convert(init.getToken()));
                }
            }
        }
        for (int i = 0; i < input.getWidth(); i++) {
View Full Code Here


        $ASSIGN$_latestSum(_sum);
        $ASSIGN$_latestCount(_count);
        for (int i = 0; i < reset.getWidth(); i++) {
            if (reset.hasToken(i)) {
                BooleanToken r = (BooleanToken)reset.get(i);
                if (r.booleanValue()) {
                    $ASSIGN$_latestSum(null);
                    $ASSIGN$_latestCount(0);
                }
            }
        }
View Full Code Here

            Token t = ((Variable) attribute).getToken();
            return ((BooleanToken) t).booleanValue();
        } else if (attribute instanceof Settable) {
            BooleanToken t = new BooleanToken(((Settable) attribute)
                    .getExpression());
            return t.booleanValue();
        } else {
            throw new IllegalActionException(this,
                    "The specified model does not have an evaluatedValue parameter.");
        }
    }
View Full Code Here

            BooleanToken result = array1.getElement(i).isCloseTo(
                    array2.getElement(i), epsilon);

            // If the tokens are not close and array1[i] and is not nil, then
            // the arrays really aren't close.
            if (result.booleanValue() == false) {
                if (array1.getElement(i).isNil()
                        && array2.getElement(i).isNil()) {
                    // They are not close, but both are nil, so for
                    // our purposes, the are close.
                } else {
View Full Code Here

                    "This is not a decodable code.");
        }

        BooleanToken inputToken = (BooleanToken) input.get(0);

        if (inputToken.booleanValue()) {
            _code = _code + "1";
        } else {
            _code = _code + "0";
        }
View Full Code Here

        // Exclusive-or with the input if there is any.
        for (int i = 0; i < input.getWidth(); i++) {
            if (input.hasToken(0)) {
                BooleanToken inputToken = (BooleanToken) input.get(0);
                boolean inputTokenValue = inputToken.booleanValue();
                parity = parity ^ (inputTokenValue ? 1 : 0);
            }
        }

        _latestShiftReg = reg | parity;
View Full Code Here

        for (int i = 0; i < _inputNumber; i++) {
            reg = reg << 1;

            BooleanToken input = (BooleanToken) inputToken[i];
            reg = reg | (input.booleanValue() ? 1 : 0);
        }

        _latestShiftReg = reg;

        // Compute the parities for all polynomials respectively.
View Full Code Here

        super.fire();

        if ((ledRed.getWidth() > 0) && ledRed.hasToken(0)) {
            BooleanToken red = (BooleanToken) ledRed.get(0);

            if (red.booleanValue()) {
                _redOn();
            } else {
                _redOff();
            }
        }
View Full Code Here

        }

        if ((ledGreen.getWidth() > 0) && ledGreen.hasToken(0)) {
            BooleanToken green = (BooleanToken) ledGreen.get(0);

            if (green.booleanValue()) {
                _greenOn();
            } else {
                _greenOff();
            }
        }
View Full Code Here

        }

        if ((ledYellow.getWidth() > 0) && ledYellow.hasToken(0)) {
            BooleanToken yellow = (BooleanToken) ledYellow.get(0);

            if (yellow.booleanValue()) {
                _yellowOn();
            } else {
                _yellowOff();
            }
        }
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.