Examples of StringToken


Examples of ptolemy.data.StringToken

        input.setTypeEquals(BaseType.STRING);

        output = new TypedIOPort(this, "output", false, true);
        output.setTypeEquals(BaseType.STRING);

        prompt = new PortParameter(this, "prompt", new StringToken(">>"));

        // Make command be a StringParameter (no surrounding double quotes).
        prompt.setTypeEquals(BaseType.STRING);
        prompt.setStringMode(true);
View Full Code Here

Examples of ptolemy.data.StringToken

        if (userCommand.trim().equalsIgnoreCase("quit")
                || userCommand.trim().equalsIgnoreCase("exit")) {
            _returnFalseInPostfire = true;
        }

        output.broadcast(new StringToken(userCommand));
    }
View Full Code Here

Examples of ptolemy.data.StringToken

            throws IllegalActionException, NameDuplicationException {
        super(container, name);
        defaultValue = new Parameter(this, "defaultValue", new IntToken(0));
        output.setTypeAtLeast(input);
        output.setTypeAtLeast(defaultValue);
        new Parameter(input, "signalType", new StringToken("DISCRETE"));
        new Parameter(output, "signalType", new StringToken("CONTINUOUS"));

        _attachText("_iconDescription", "<svg>\n"
                + "<rect x=\"-30\" y=\"-20\" " + "width=\"60\" height=\"40\" "
                + "style=\"fill:white\"/>\n"
                + "<polyline points=\"-25,10 -15,10 -15,-10 5,-10\"/>\n"
View Full Code Here

Examples of ptolemy.data.StringToken

        // Set the type of the output port.
        output.setTypeEquals(BaseType.STRING);

        // Set the endsWith String.
        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));
View Full Code Here

Examples of ptolemy.data.StringToken

    public void attributeChanged(Attribute attribute)
            throws IllegalActionException {
        if (attribute == repeat) {
            _repeatFlag = ((BooleanToken) repeat.getToken()).booleanValue();
        } else if (attribute == endsWith) {
            StringToken endsWithToken = (StringToken) endsWith.getToken();

            if (endsWithToken == null) {
                _endsWithValue = null;
            } else {
                _endsWithValue = endsWithToken.stringValue();
            }
        }

        super.attributeChanged(attribute);
    }
View Full Code Here

Examples of ptolemy.data.StringToken

    /** Output the data read in the prefire.
     *  @exception IllegalActionException If there's no director.
     */
    public void fire() throws IllegalActionException {
        super.fire();
        output.broadcast(new StringToken(_data[_iterationCount]));
    }
View Full Code Here

Examples of ptolemy.data.StringToken

            seedValue = System.currentTimeMillis() + hashCode();
        } else {
            seedValue = seedValue + getFullName().hashCode();
        }

        StringToken generatorToken = ((StringToken) generatorClass.getToken());
        String generatorClassValue = null;

        if (generatorToken != null) {
            generatorClassValue = generatorToken.stringValue();
        }

        _generatorClassName = generatorClassValue;

        if ((generatorClassValue == null)
View Full Code Here

Examples of ptolemy.data.StringToken

        //defaultRemoteAddress.setExpression("localhost");
        // Above way was set w/o quotes vs constant which is set with them.
        // This has been confusing, so I've switched to the approach below.
        defaultRemoteAddress = new Parameter(this, "defaultRemoteAddress");
        defaultRemoteAddress.setTypeEquals(BaseType.STRING);
        defaultRemoteAddress.setToken(new StringToken("localhost"));

        defaultRemoteSocketNumber = new Parameter(this,
                "defaultRemoteSocketNumber");
        defaultRemoteSocketNumber.setTypeEquals(BaseType.INT);
        defaultRemoteSocketNumber.setExpression("4004"); //setExpression works
View Full Code Here

Examples of ptolemy.data.StringToken

        // Set the type of the output port.
        output.setMultiport(true);
        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);
View Full Code Here

Examples of ptolemy.data.StringToken

     *   is <i>URL</i> and the file cannot be opened.
     */
    public void attributeChanged(Attribute attribute)
            throws IllegalActionException {
        if (attribute == sourceURL) {
            StringToken urlToken = null;

            try {
                urlToken = (StringToken) sourceURL.getToken();

                if (urlToken == null) {
                    _source = null;
                    _setURLReader(null);
                } else {
                    _source = urlToken.stringValue();

                    if (_source.equals("")) {
                        _setURLReader(null);
                    } else {
                        URL url = new URL(_source);
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.