Package ptolemy.data

Examples of ptolemy.data.ArrayToken


     */
    public JAIBandSelect(CompositeEntity container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);

        bandIndices = new Parameter(this, "bandIndices", new ArrayToken(
                BaseType.INT, _initialArray));
    }
View Full Code Here


        borderType = new StringAttribute(this, "borderType");
        borderType.setExpression("Zero");
        _borderType = _BORDER_ZERO;

        constants = new Parameter(this, "constants", new ArrayToken(
                BaseType.DOUBLE, _initialArray));
    }
View Full Code Here

                            if (_debugging) {
                                _debug(getName(), "transferring input from "
                                        + port.getName());
                            }

                            ArrayToken arrayToken = (ArrayToken) t;

                            for (int j = 0; j < arrayToken.length(); j++) {
                                port.sendInside(i, arrayToken.getElement(j));
                            }

                            result = true;
                        }
                    }
View Full Code Here

                        if (_debugging) {
                            _debug(getName(), "transferring output to "
                                    + port.getName());
                        }

                        port.send(i, new ArrayToken(elementType, tokens));
                    } else {
                        // Send an empty list
                        port.send(i, new ArrayToken(elementType));
                    }

                    result = true;
                } catch (NoTokenException ex) {
                    throw new InternalErrorException(this, ex, null);
View Full Code Here

            if (_rate[i] == -1) {
                arguments[i] = port.get(0);
            } else {
                Token[] tokens = port.get(0, _rate[i]);
                arguments[i] = new ArrayToken(port.getType(), tokens);
            }

            i++;
        }

        Token result = functionValue.apply(arguments);

        if (_outputRate == -1) {
            output.broadcast(result);
        } else {
            // FIXME: Check size.
            ArrayToken resultArray = (ArrayToken) result;
            output.broadcast(resultArray.arrayValue(), resultArray.length());
        }
    }
View Full Code Here

     @return The polyline.
     *  @exception IllegalActionException If polyline parameter
     *   cannot be evaluated.
     */
    private float[] _getPolyline() throws IllegalActionException {
        ArrayToken token = ((ArrayToken) polyline.getToken());
        int numberOfElements = token.length();
        float[] data = new float[numberOfElements];

        for (int i = 0; i < numberOfElements; i++) {
            data[i] = (float) ((DoubleToken) (token.getElement(i)))
                    .doubleValue();
        }

        return data;
    }
View Full Code Here

     @return The vertex count.
     *  @exception IllegalActionException If the polyline parameter
     *   cannot be evaluated.
     */
    private int _getVertexCount() throws IllegalActionException {
        ArrayToken token = ((ArrayToken) polyline.getToken());
        return token.length() / 2;
    }
View Full Code Here

            index++;
        }

        // Update the tapValues output.
        // NOTE: This may be a relatively costly operation to be doing here.
        tapValues.send(0, new ArrayToken(_taps));

        // Then run FIR filter
        super.fire();
    }
View Full Code Here

        int length = ((IntToken) arrayLength.getToken()).intValue();

        Token[] valueArray = new Token[length];
        System.arraycopy(input.get(0, length), 0, valueArray, 0, length);

        output.broadcast(new ArrayToken(input.getType(), valueArray));
    }
View Full Code Here

     @exception IllegalActionException If parameter values are invalid,
     *   or if there is no director, or if runtime type conflicts occur.
     */
    public void fire() throws IllegalActionException {
        if (newTaps.hasToken(0)) {
            ArrayToken tapsToken = (ArrayToken) (newTaps.get(0));
            _taps = tapsToken.arrayValue();

            // Get a token representing zero in the appropriate type.
            _zero = _taps[0].zero();

            _reinitialize();
View Full Code Here

TOP

Related Classes of ptolemy.data.ArrayToken

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.