Examples of BooleanToken


Examples of ptolemy.data.BooleanToken

     */
    public KeyReader(CompositeEntity container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);

        getPublicKey = new Parameter(this, "getPublicKey", new BooleanToken(
                true));
        getPublicKey.setTypeEquals(BaseType.BOOLEAN);

        output = new TypedIOPort(this, "output", false, true);
        output.setTypeEquals(KeyToken.KEY);

        trigger = new TypedIOPort(this, "trigger", true, false);

        // NOTE: It used to be that trigger was set to GENERAL, but this
        // isn't really what we want.  What we want is an undeclared type
        // that can resolve to anything.
        // trigger.setTypeEquals(BaseType.GENERAL);
        trigger.setMultiport(true);

        signatureAlgorithm = new StringParameter(this, "signatureAlgorithm");
        signatureAlgorithm
                .setExpression("Unknown, will be set after first run");
        signatureAlgorithm.setVisibility(Settable.NOT_EDITABLE);
        signatureAlgorithm.setPersistent(false);

        verifyCertificate = new Parameter(this, "verifyCertificate",
                new BooleanToken(true));
        verifyCertificate.setTypeEquals(BaseType.BOOLEAN);
    }
View Full Code Here

Examples of ptolemy.data.BooleanToken

        endsWith = new Parameter(this, "endsWith", new StringToken(""));
        endsWith.setTypeEquals(BaseType.STRING);
        attributeChanged(endsWith);

        // Set the repeat Flag.
        repeat = new Parameter(this, "repeat", new BooleanToken(false));
        repeat.setTypeEquals(BaseType.BOOLEAN);
        attributeChanged(repeat);
    }
View Full Code Here

Examples of ptolemy.data.BooleanToken

     @exception IllegalActionException If calling send() or super.fire()
     throws it.
     */
    public void fire() throws IllegalActionException {
        super.fire();
        output.send(0, new BooleanToken(_current));
    }
View Full Code Here

Examples of ptolemy.data.BooleanToken

            throws IllegalActionException, NameDuplicationException {
        super(container, name);
        input.setTypeEquals(BaseType.DOUBLE);
        output.setTypeEquals(BaseType.DOUBLE);

        inputIsPower = new Parameter(this, "inputIsPower", new BooleanToken(
                false));
        inputIsPower.setTypeEquals(BaseType.BOOLEAN);
        min = new Parameter(this, "min", new DoubleToken(-100.0));
        min.setTypeEquals(BaseType.DOUBLE);
    }
View Full Code Here

Examples of ptolemy.data.BooleanToken

        if (!input.hasToken(0) && !_code.equals("")) {
            throw new IllegalActionException(this,
                    "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

Examples of ptolemy.data.BooleanToken

     * @exception IllegalActionException If the output receiver throws it.
     */
    private void _sendBooleans(String codeword) throws IllegalActionException {
        for (int i = 0; i < codeword.length(); i++) {
            if (codeword.charAt(i) == '1') {
                output.send(0, new BooleanToken(true));
            } else {
                output.send(0, new BooleanToken(false));
            }
        }
    }
View Full Code Here

Examples of ptolemy.data.BooleanToken

        output.setTypeEquals(BaseType.DOUBLE);

        sourceURL = new Parameter(this, "sourceURL", new StringToken(""));
        sourceURL.setTypeEquals(BaseType.STRING);

        refresh = new Parameter(this, "refresh", new BooleanToken(false));
        refresh.setTypeEquals(BaseType.BOOLEAN);

        if (_stdIn == null) {
            _stdIn = new BufferedReader(new InputStreamReader(System.in));
        }
View Full Code Here

Examples of ptolemy.data.BooleanToken

        } else if (value instanceof Long) {
            tmp = new LongToken(((Long) value).longValue());
        } else if (value instanceof String) {
            tmp = new StringToken((String) value);
        } else if (value instanceof Boolean) {
            tmp = new BooleanToken(((Boolean) value).booleanValue());
        } else if (value instanceof Complex) {
            tmp = new ComplexToken((Complex) value);
        } else {
            throw new IllegalArgumentException("PtParser: cannot register "
                    + name + "  as a constant of the parser.");
View Full Code Here

Examples of ptolemy.data.BooleanToken

        _decodeBook.add(current);

        for (int i = 0; i < current.length(); i++) {
            if (current.charAt(i) == '0') {
                output.send(0, new BooleanToken(false));
            } else {
                output.send(0, new BooleanToken(true));
            }
        }
    }
View Full Code Here

Examples of ptolemy.data.BooleanToken

        } else if (type == BaseType.BOOLEAN) {

            boolean[][] tokens = (boolean[][]) outputTokens;
            for (int i = 0; i < port.getWidthInside(); i++) {
                for (int k = 0; k < rate; k++) {
                    Token token = new BooleanToken(tokens[i][k]);
                    port.send(i, token);
                }
            }

        } else {
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.