Examples of UnionToken


Examples of ptolemy.data.UnionToken

                if (firstAvailableToken == null) {
                    // we see the first available tokens
                    String label = port.getName();
                    firstAvailableToken = port.get(0);

                    UnionToken outputToken = new UnionToken(label,
                            firstAvailableToken);
                    output.send(0, outputToken);

                    while (port.hasToken(0)) {
                        label = port.getName();

                        Token value = port.get(0);
                        outputToken = new UnionToken(label, value);
                        output.send(0, outputToken);
                    }
                } else {
                    if (discard) {
                        // this token is not the first available token
View Full Code Here

Examples of ptolemy.data.UnionToken

        if (director == null) {
            throw new IllegalActionException(this, "No director!");
        }

        if (input.hasToken(0)) {
            UnionToken union = (UnionToken) input.get(0);
            String label = union.label();
            Token value = union.value();

            IOPort port = (IOPort) getPort(label);
            if (port != null) {
                port.send(0, value);
            }
View Full Code Here

Examples of ptolemy.data.UnionToken

        if (!isCompatible(token.getType())) {
            throw new IllegalArgumentException(Token
                    .notSupportedConversionMessage(token, this.toString()));
        }

        UnionToken unionToken = (UnionToken) token;

        // The converted token has the same label as this one.
        String label = unionToken.label();
        Type newType = get(label);
        Token newValue = newType.convert(unionToken.value());
        return new UnionToken(label, newValue);
    }
View Full Code Here

Examples of ptolemy.data.UnionToken

        //        "has more than one member type of the union.");

        //If there is more than one members in the union, take the first
        //member value as the value of the union.
        if (labels.length > 0) {
            _evaluatedChildToken = (new UnionToken(labels[0], tokens[0]));
        }
        _evaluatedChildToken = (new UnionToken(labels[0], tokens[0]));

        if (node.isConstant()) {
            node.setToken(_evaluatedChildToken);
        }
    }
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.