Package ptolemy.data

Examples of ptolemy.data.IntToken.intValue()


            br = chooseBranch(requiredBranches);

            if (br != -1) {
                IntToken token = (IntToken) requiredBranches[br].getToken();
                code = token.intValue();
                _winningPortChannelCode = new PortChannelCode(requestInput, br,
                        code);
            }

            //
View Full Code Here


                br = chooseBranch(requiredBranches);

                // Contention Occurred...and might happen again
                if ((br >= 0) && (br < _numRequestInChannels)) {
                    IntToken token = (IntToken) requiredBranches[br].getToken();
                    code = token.intValue();

                    if (code > _winningPortChannelCode.getCode()) {
                        _losingPortChannelCodes.add(0, _winningPortChannelCode);
                        _winningPortChannelCode = new PortChannelCode(
                                requestInput, br, code);
View Full Code Here

        byte[] dataBytes = new byte[dataIntArrayToken.length()];

        for (int j = 0; j < dataIntArrayToken.length(); j++) {
            IntToken dataIntOneToken = (IntToken) dataIntArrayToken
                    .getElement(j);
            dataBytes[j] = (byte) dataIntOneToken.intValue(); //Keep low 8 bits
        }

        // Note:  Following line may assume 1 byte per character, not sure.
        String outputValue = new String(dataBytes);
        output.send(0, new StringToken(outputValue));
View Full Code Here

        env.bind("INT19_mul", _theContext.createFunction(new Function() {
            public Object apply(Object[] args) {
                try {
                    IntToken a = (IntToken) args[0];
                    IntToken b = (IntToken) args[1];
                    int res = (a.intValue() * b.intValue()); // & 0x7ffff;
                    return _theContext.createInteger(res);
                } catch (Exception ex) {
                    throw new InterpreterException(
                            "Function 'RGBCLIP': Cannot apply.", ex);
                }
View Full Code Here

        if (director != null) {
            Attribute attribute = director.getAttribute("iterations");

            if (attribute instanceof Variable) {
                IntToken token = (IntToken) ((Variable) attribute).getToken();
                iterationLimit = token.intValue();
            }
        }
        // Inline the director
        {
            // populate the preinitialize method
View Full Code Here

                    .getAttribute("frequency");

            if (parameter != null) {
                IntToken intToken = (IntToken) parameter.getToken();

                return intToken.intValue();
            } else {
                return _DEFAULT_GIOTTO_FREQUENCY;
            }
        } catch (ClassCastException ex) {
            return _DEFAULT_GIOTTO_FREQUENCY;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.