Package ptolemy.data

Examples of ptolemy.data.IntToken


        super(container, name);

        formatName = new StringAttribute(this, "formatName");
        formatName.setExpression("RGB");

        deviceNumber = new Parameter(this, "deviceNumber", new IntToken(0));

        // FIXME: output should perhaps be named "video"?
        // In case there is audio track.
        // Don't derive from source in this case.
        output.setTypeEquals(BaseType.OBJECT);
View Full Code Here


        super.fire();
        Token result = null;

        if (A.hasToken(0) && B.hasToken(0) && operation.hasToken(0)) {
            int opcode = ((IntToken) operation.get(0)).intValue();
            IntToken tokenA = (IntToken) A.get(0);
            IntToken tokenB = (IntToken) B.get(0);

            switch (opcode) {
            case 0: // NOP
                result = IntToken.ZERO;
                break;
View Full Code Here

     @exception IllegalActionException If there is no director.
     */
    public void fire() throws IllegalActionException {
        mean.update();
        super.fire();
        output.send(0, new IntToken(_current));
    }
View Full Code Here

        defaultRemoteSocketNumber.setExpression("4004"); //setExpression works

        // Pure parameters
        localSocketNumber = new Parameter(this, "localSocketNumber");
        localSocketNumber.setTypeEquals(BaseType.INT);
        localSocketNumber.setToken(new IntToken(4003)); //setToken works too

        // Added for SDF usability.  Empty Token() is output, just a trigger.
        triggerOutput = new TypedIOPort(this, "triggerOutput");
        triggerOutput.setTypeEquals(BaseType.GENERAL);
View Full Code Here

        onOff.setTypeEquals(BaseType.BOOLEAN);

        percentGain = new IntRangeParameter(this, "percentGain");

        // Set the default value to full scale.
        percentGain.setToken(new IntToken(100));
    }
View Full Code Here

        }
        ptolemy.data.Token tmp;
        if (value instanceof ptolemy.data.Token) {
            tmp = (ptolemy.data.Token) value;
        } else if (value instanceof Integer) {
            tmp = new IntToken(((Integer) value).intValue());
        } 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) {
View Full Code Here

            }
        }

        if (result != null) {
            minimumValue.broadcast(result);
            channelNumber.broadcast(new IntToken(channelNum));
        }
    }
View Full Code Here

                                .parseInt(x, radix));
                    } else {
                        // Try to infer the size.  Inferred sizes are at least
                        // integer.
                        try {
                            jjtn003._ptToken = new IntToken(Integer.parseInt(x,
                                    radix));
                        } catch (NumberFormatException nfe) {
                            jjtn003._ptToken = new LongToken(Long.parseLong(x,
                                    radix));
                        }
View Full Code Here

            throws IllegalActionException, NameDuplicationException {
        super(container, name);
        input.setTypeEquals(BaseType.OBJECT);
        output.setTypeEquals(BaseType.OBJECT);
        rotationInDegrees = new Parameter(this, "rotationInDegrees",
                new IntToken(90));
        rotationInDegrees.setTypeEquals(BaseType.INT);
    }
View Full Code Here

        // Send the output array.
        Token[] values = new Token[_bins.length];

        for (int i = 0; i < _bins.length; i++) {
            values[i] = new IntToken(_bins[i]);
        }

        output.send(0, new ArrayToken(BaseType.INT, values));
    }
View Full Code Here

TOP

Related Classes of ptolemy.data.IntToken

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.