Package ptolemy.data

Examples of ptolemy.data.StringToken.stringValue()


        start.update();
        stop.update();

        if (input.hasToken(0)) {
            StringToken inputToken = (StringToken) input.get(0);
            String value = inputToken.stringValue();
            int startValue = ((IntToken) start.getToken()).intValue();
            int stopValue = ((IntToken) stop.getToken()).intValue();
            String substringValue;

            if (stopValue == -1) {
View Full Code Here


    public void fire() throws IllegalActionException {
        super.fire();

        if (input.hasToken(0)) {
            StringToken inputToken = (StringToken) input.get(0);
            String value = inputToken.stringValue();
            int length = value.length();
            output.send(0, new IntToken(length));
        }
    }
}
View Full Code Here

    public void fire() throws IllegalActionException {
        super.fire();

        if (input.hasToken(0)) {
            StringToken inputToken = (StringToken) input.get(0);
            String value = inputToken.stringValue();
            output.send(0, new StringToken(_doFunction(value)));
        }
    }

    ///////////////////////////////////////////////////////////////////
View Full Code Here

                while (labels.hasNext()) {
                    String name = (String) labels.next();
                    Token token = parameters.get(name);
                    if (token instanceof StringToken) {
                        StringToken s = (StringToken) token;
                        _transformer.setParameter(name, s.stringValue());
                    } else {
                        _transformer.setParameter(name, token.toString());
                    }
                }
            }
View Full Code Here

                if (URLToken == null) {
                    _source = null;
                    setReader(null);
                } else {
                    _source = URLToken.stringValue();

                    if (_source.equals("")) {
                        setReader(null);
                    } else {
                        URL url = new URL(_source);
View Full Code Here

                        .getToken();

                for (int i = 0; i < demoTokens.length(); i++) {
                    StringToken demoToken = (StringToken) demoTokens
                            .getElement(i);
                    htmlBuffer.append(_aboutHTML(demoToken.stringValue()));
                    _demosURLs.add(demoToken.stringValue());
                }
            }
        } catch (Exception ex) {
            throw new InternalErrorException(configuration, ex,
View Full Code Here

                for (int i = 0; i < demoTokens.length(); i++) {
                    StringToken demoToken = (StringToken) demoTokens
                            .getElement(i);
                    htmlBuffer.append(_aboutHTML(demoToken.stringValue()));
                    _demosURLs.add(demoToken.stringValue());
                }
            }
        } catch (Exception ex) {
            throw new InternalErrorException(configuration, ex,
                    "Bad configuration for " + applicationName);
View Full Code Here

                StringToken filenameToken = (StringToken) filename.getToken();

                if (filenameToken == null) {
                    setWriter(null);
                } else {
                    String newFilename = filenameToken.stringValue();

                    if (newFilename.equals("")) {
                        setWriter(null);
                    } else {
                        java.io.FileWriter writer = new java.io.FileWriter(
View Full Code Here

        for (int i = 0; i < input.getWidth(); i++) {
            if (input.hasToken(i)) {
                StringToken in = (StringToken) input.get(i);

                try {
                    _outToken = new XMLToken(in.stringValue());
                    output.broadcast(_outToken);

                    //k++;
                } catch (java.lang.Exception ex) {
                    throw new IllegalActionException(this, ex,
View Full Code Here

                    StringToken actorToken = (StringToken) (((RecordToken) copyrightTokens
                            .getElement(i)).get("actor"));
                    StringToken copyrightToken = (StringToken) (((RecordToken) copyrightTokens
                            .getElement(i)).get("copyright"));
                    _addIfPresent(copyrightsMap, actorToken.stringValue(),
                            copyrightToken.stringValue());
                }
            }
        } catch (Exception ex) {
            System.out.println(ex);
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.