Package ptolemy.data

Examples of ptolemy.data.StringToken


            // FIXME: only produce the code book if the parameters
            // have been updated.
            StringToken[] codeBookTokens = new StringToken[_pmf.length];

            for (int i = 0; i < _pmf.length; i++) {
                codeBookTokens[i] = new StringToken(_codeBook[i]);
            }

            huffmanCodeBook.send(0, new ArrayToken(BaseType.STRING,
                    codeBookTokens));
        }
View Full Code Here


        } else if (value instanceof Double) {
            tmp = new DoubleToken(((Double) value).doubleValue());
        } 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 {
View Full Code Here

        boolean jjtc001 = true;
        jjtree.openNodeScope(jjtn001);
        try {
            jjtree.closeNodeScope(jjtn001, true);
            jjtc001 = false;
            jjtn001._ptToken = new StringToken(token.image.replaceAll("\\$\\$",
                    "\\$"));
            jjtn001._isConstant = true;
        } finally {
            if (jjtc001) {
                jjtree.closeNodeScope(jjtn001, true);
View Full Code Here

                                            + "string: " + token.image);
                        }
                    }
                }

                jjtn004._ptToken = new StringToken(x);
                jjtn004._isConstant = true;
            } finally {
                if (jjtc004) {
                    jjtree.closeNodeScope(jjtn004, true);
                }
View Full Code Here

        start = new TypedIOPort(this, "start");
        start.setInput(true);

        // type is undeclared.
        // Annotate DISCRETE, for the benefit of CT.
        new Parameter(start, "signalType", new StringToken("DISCRETE"));

        // stop port.
        stop = new TypedIOPort(this, "stop");
        stop.setInput(true);

        // type is undeclared.
        // Annotate DISCRETE, for the benefit of CT.
        new Parameter(stop, "signalType", new StringToken("DISCRETE"));
    }
View Full Code Here

            if (input.hasToken(i)) {
                ImageToken imageToken = (ImageToken) input.get(i);
                Image image = imageToken.asAWTImage();
                String description = "Image: " + image.getWidth(null) + " x "
                        + image.getHeight(null);
                Token out = new StringToken(description);
                output.broadcast(out);
            }
        }
    }
View Full Code Here

     *  that contains a java.awt.Image object to the output port.
     *  @exception IllegalActionException If there's no director.
     */
    public void fire() throws IllegalActionException {
        super.fire();
        StringToken urlToken = (StringToken) input.get(0);

        try {
            URL url = new URL(urlToken.stringValue());
            Image image = new ImageIcon(url).getImage();
            output.send(0, new AWTImageToken(image));
        } catch (MalformedURLException ex) {
            throw new IllegalActionException("'" + urlToken.stringValue()
                    + "' is malformed: " + ex);
        }
    }
View Full Code Here

     * @exception IllegalActionException If there is an error
     *  in executing getNextToken().
     */
    public void fire() throws IllegalActionException {
        super.fire();
        StringToken token = null;
        Time time;

        while (true) {
            token = (StringToken) getNextToken();
            time = getDirector().getModelTime();

            if (token == null) {
                System.out.println("Null token in PrintString");
            } else {
                System.out.println("\t" + token.toString() + "\tTime is "
                        + time);
            }
        }
    }
View Full Code Here

        super.fire();
        if (input.hasToken(0)) {
            input.get(0);

            String string = (String) _contents.get(_cntr);
            output.broadcast(new StringToken(string));
            _cntr++;

            if (_cntr == _contents.size()) {
                _cntr = 0;
            }
View Full Code Here

        super(container, name);

        input.setTypeEquals(BaseType.INT_MATRIX);
        output.setTypeEquals(BaseType.INT);

        codeBook = new Parameter(this, "codeBook", new StringToken(
                "/ptolemy/domains/sdf" + "/lib/vq/data/usc_hvq_s5.dat"));
        codeBook.setTypeEquals(BaseType.STRING);

        blockCount = new Parameter(this, "blockCount", new IntToken("1"));
        blockCount.setTypeEquals(BaseType.INT);
View Full Code Here

TOP

Related Classes of ptolemy.data.StringToken

Copyright © 2018 www.massapicom. 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.