Package ptolemy.data

Examples of ptolemy.data.BooleanToken.booleanValue()


        super.fire();
        for (int i = 0; i < input.getWidth(); i++) {
            if (input.hasToken(i)) {
                BooleanToken token = (BooleanToken) input.get(i);

                if (token.booleanValue()) {
                    output.send(i, token);
                }
            }
        }
    }
View Full Code Here


        }

        BooleanToken resetToken = (BooleanToken) _lastChosenTransition.reset
                .getToken();

        if (resetToken.booleanValue()) {
            actors = _currentState.getRefinement();
            if (actors != null) {
                for (int i = 0; i < actors.length; ++i) {
                    if (_debugging) {
                        _debug(getFullName() + " initialize refinement: "
View Full Code Here

        BooleanToken equals = positionToken.isEqualTo(_position);
        equals = equals.and(axisToken.isEqualTo(_axis));
        equals = equals.and(angleToken.isEqualTo(_angle));

        if (!equals.booleanValue()) {
            double xPosition;
            double yPosition;
            double zPosition;
            double axisX;
            double axisY;
View Full Code Here

        if (object == null) {
            return NullConstant.v();
        } else if (object instanceof BooleanToken) {
            BooleanToken flag = (BooleanToken) object;

            if (flag.booleanValue()) {
                return IntConstant.v(1);
            } else {
                return IntConstant.v(0);
            }
        } else if (object instanceof IntToken) {
View Full Code Here

        } else if (object instanceof DoubleToken) {
            return DoubleConstant.v(((DoubleToken) object).doubleValue());
        } else if (object instanceof Boolean) {
            Boolean flag = (Boolean) object;

            if (flag.booleanValue()) {
                return IntConstant.v(1);
            } else {
                return IntConstant.v(0);
            }
        } else if (object instanceof Integer) {
View Full Code Here

        Attribute hideAttribute = relation.getAttribute("_hide");
        if (hideAttribute != null) {
            try {
                BooleanToken token = (BooleanToken) ((Parameter) hideAttribute)
                        .getToken();
                boolean hide = token.booleanValue();
                return hide;
            } catch (IllegalActionException e) {
            }
        }
        return false;
View Full Code Here

        // Check whether to reset.
        for (int i = 0; i < reset.getWidth(); i++) {
            if (reset.hasToken(i)) {
                BooleanToken r = (BooleanToken) reset.get(i);

                if (r.booleanValue()) {
                    // Being reset at this firing.
                    _latestSum = output.getType().convert(init.getToken());
                }
            }
        }
View Full Code Here

        if (array.hasToken(0)) {
            ArrayToken token = (ArrayToken) array.get(0);
            boolean contained = false;
            for (int i = 0; i < token.length(); i++) {
                BooleanToken bt = elementToken.isEqualTo(token.getElement(i));
                if (bt.booleanValue()) {
                    contained = true;
                    break;
                }
            }
            output.broadcast(new BooleanToken(contained));
View Full Code Here

        // Check whether to reset.
        for (int i = 0; i < reset.getWidth(); i++) {
            if (reset.hasToken(i)) {
                BooleanToken r = (BooleanToken) reset.get(i);

                if (r.booleanValue()) {
                    // Being reset at this firing.
                    _latestSum = null;
                    _latestCount = 0;
                }
            }
View Full Code Here

                try {
                    BooleanToken resetToken = (BooleanToken) transition.reset
                            .getToken();

                    if (resetToken.booleanValue()) {
                        refinements = (transition.destinationState())
                                .getRefinement();
                    }
                } catch (Exception ex) {
                    throw new RuntimeException(ex.getMessage());
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.