Package ptolemy.data.type

Examples of ptolemy.data.type.Type


                buffer.append(", ");
            }

            buffer.append((String) _argumentNames.get(i));

            Type type = _argumentTypes[i];

            if (type != BaseType.GENERAL) {
                buffer.append(":");
                buffer.append(type.toString());
            }
        }

        buffer.append(") ");
View Full Code Here


        if (actor.output.getType() == BaseType.STRING) {
            _codeStream.appendCodeBlock("StringInitBlock");
        } else {
            _codeStream.appendCodeBlock("CommonInitBlock", args);
            if (actor.output.getType() instanceof ArrayType) {
                Type elementType = ((ArrayType) actor.output.getType())
                        .getElementType();

                args.set(0, "TYPE_" + codeGenType(elementType));
                if (!actor.step.getType().equals(actor.output.getType())) {
                    _codeStream.appendCodeBlock("ArrayConvertStepBlock", args);
View Full Code Here

        StringBuffer fireCode = new StringBuffer();
        ArrayList args = new ArrayList();
        args.add(Integer.valueOf(0));

        Type type = actor.input.getType();
        if (isPrimitive(type)) {
            args.add(codeGenType(type));
        }

        for (int i = 0; i < actor.input.getWidth(); i++) {
View Full Code Here

        ptolemy.actor.lib.SubscriptionAggregator actor = (ptolemy.actor.lib.SubscriptionAggregator) getComponent();

        ArrayList args = new ArrayList();

        Type type = actor.output.getType();
        args.add(targetType(type));

        if (_codeStream.isEmpty()) {
            _codeStream.append(_eol
                    + _codeGenerator.comment("preinitialize "
View Full Code Here

        ptolemy.actor.lib.AddSubtract actor = (ptolemy.actor.lib.AddSubtract) getComponent();

        ArrayList args = new ArrayList();

        Type type = actor.output.getType();
        args.add(targetType(type));

        if (_codeStream.isEmpty()) {
            _codeStream.append(_eol
                    + _codeGenerator.comment("preinitialize "
View Full Code Here

                if (i != 0) {
                    arguments.append(", ");
                }
                i++;
                //FIXME: need to consider carefully for structured data type
                Type type = ((TypedIOPort) inputPort).getType();
                String typeName = type.toString();
                if (typeName.equals("unknown") || typeName.equals("Pointer")) {
                    // If a port is not connected, then use int as a default.
                    typeName = "int";
                }
                arguments.append(typeName + "[][] " + inputPort.getName());
View Full Code Here

    private Object _transferInputs(IOPort port) throws IllegalActionException {

        int rate = DFUtilities.getTokenConsumptionRate(port);
        // FIXME: FindBugs indicates that this cast might not be safe.
        Type type = ((TypedIOPort) port).getType();
        Object tokenHolder = null;

        int numberOfChannels = port.getWidth() < port.getWidthInside() ? port
                .getWidth() : port.getWidthInside();
View Full Code Here

    private void _transferOutputs(IOPort port, Object outputTokens)
            throws IllegalActionException {

        int rate = DFUtilities.getTokenProductionRate(port);
        // FIXME: FindBugs indicates that this cast might not be safe.
        Type type = ((TypedIOPort) port).getType();
        if (type == BaseType.INT) {

            int[][] tokens = (int[][]) outputTokens;
            for (int i = 0; i < port.getWidthInside(); i++) {
                for (int k = 0; k < rate; k++) {
View Full Code Here

        for (Iterator portsIterator = portTypes.keySet().iterator(); portsIterator
                .hasNext();) {
            String portName = (String) portsIterator.next();
            TypedIOPort port = (TypedIOPort) ((ComponentEntity) actor)
                    .getPort(portName);
            Type type = (Type) portTypes.get(portName);
            port.setTypeEquals(type);

            // This is not needed, does not trigger runtime type checking on
            // these ports.
View Full Code Here

     */
    public void attributeChanged(Attribute attribute)
            throws IllegalActionException {
        if (attribute == outputType) {
            String typeName = outputType.getExpression().trim().toLowerCase();
            Type newType = BaseType.forName(typeName);

            if (newType == null) {
                throw new IllegalActionException(this, "Unrecognized type: "
                        + typeName);
            } else {
View Full Code Here

TOP

Related Classes of ptolemy.data.type.Type

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.