Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.Attribute


     @param t The element value.
     *  @exception IllegalActionException If the model does not have a
     *   settable attribute named "inputArrayElement".
     */
    private void _updateParameter(Token t) throws IllegalActionException {
        Attribute attribute = _model.getAttribute("inputArrayElement");

        // Use the token directly rather than a string if possible.
        if (attribute instanceof Variable) {
            if (_debugging) {
                _debug("** Transferring input to parameter inputArrayElement.");
View Full Code Here


     @return The value of the "evaluatedValue" parameter.
     *  @exception IllegalActionException If the model does not have a
     *   settable attribute named "evaluatedValue".
     */
    private boolean _getResult() throws IllegalActionException {
        Attribute attribute = _model.getAttribute("evaluatedValue");

        if (attribute instanceof Variable) {
            Token t = ((Variable) attribute).getToken();
            return ((BooleanToken) t).booleanValue();
        } else if (attribute instanceof Settable) {
View Full Code Here

                continue;
            }

            if ((port.getWidth() > 0) && port.hasToken(0)) {
                Token token = port.get(0);
                Attribute attribute = getAttribute(port.getName());

                // Use the token directly rather than a string if possible.
                if (attribute instanceof Variable) {
                    if (_debugging) {
                        _debug("** Transferring input to parameter: "
View Full Code Here

        while (ports.hasNext()) {
            IOPort port = (IOPort) ports.next();

            // Only write if the port has a connected channel.
            if (port.getWidth() > 0) {
                Attribute attribute = getAttribute(port.getName());

                // Use the token directly rather than a string if possible.
                if (attribute instanceof Variable) {
                    if (_debugging) {
                        _debug("** Transferring parameter to output: "
View Full Code Here

            }

            rate.setToken(new IntToken(1));

            String portName = port.getName();
            Attribute attribute = getAttribute(portName);

            if (attribute == null) {
                try {
                    workspace().getWriteAccess();
                    attribute = new Variable(this, portName);
View Full Code Here

    protected void _exportMoMLContents(Writer output, int depth)
            throws IOException {
        Iterator attributes = attributeList().iterator();

        while (attributes.hasNext()) {
            Attribute attribute = (Attribute) attributes.next();
            attribute.exportMoML(output, depth);
        }

        Iterator ports = portList().iterator();

        while (ports.hasNext()) {
View Full Code Here

            if ((port.getWidth() > 0) && port.hasToken(0)) {
                Token token = port.get(0);

                if (_model != null) {
                    Attribute attribute = _model.getAttribute(port.getName());

                    // Use the token directly rather than a string if possible.
                    if (attribute instanceof Variable) {
                        if (_debugging) {
                            _debug("** Transferring input to parameter: "
View Full Code Here

        while (ports.hasNext()) {
            IOPort port = (IOPort) ports.next();

            // Only write if the port has a connected channel.
            if (port.getWidth() > 0) {
                Attribute attribute = _model.getAttribute(port.getName());

                // Use the token directly rather than a string if possible.
                if (attribute instanceof Variable) {
                    if (_debugging) {
                        _debug("** Transferring parameter to output: "
View Full Code Here

    protected void _exportMoMLContents(Writer output, int depth)
            throws IOException {
        Iterator attributes = attributeList().iterator();

        while (attributes.hasNext()) {
            Attribute attribute = (Attribute) attributes.next();
            attribute.exportMoML(output, depth);
        }

        Iterator ports = portList().iterator();

        while (ports.hasNext()) {
View Full Code Here

        //String[] labels = new String[length];
        //Token[] values = new Token[length];
        for (int i = 0; i < length; i++) {
            String label = (String) labels[i];
            Attribute attribute = model.getAttribute(label);

            // Use the token directly rather than a string if possible.
            if (attribute != null) {
                Token token = args.get(label);
View Full Code Here

TOP

Related Classes of ptolemy.kernel.util.Attribute

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.