Package ptolemy.data.type

Examples of ptolemy.data.type.FixType


    /** Return the type of this token.
     *  @return an instance of FixType;
     */
    public Type getType() {
        return new FixType(_value.getPrecision());
    }
View Full Code Here


                ptolemy.data.Token length = parseTreeEvaluator
                        .evaluateParseTree(lengthNode, _scope);

                ptolemy.data.Token integerBits = parseTreeEvaluator
                        .evaluateParseTree(integerBitsNode, _scope);
                _setType(node, new FixType(new Precision(((ScalarToken) length)
                        .intValue(), ((ScalarToken) integerBits).intValue())));
                return;
            } catch (Throwable throwable) {
                // Do nothing... rely on the regular method resolution
                // to generate the right type.
View Full Code Here

                        "Invalid precision (not a 1 by 2 matrix).");
            }

            Precision precision = new Precision(token.getElementAt(0, 0), token
                    .getElementAt(0, 1));
            output.setTypeEquals(new FixType(precision));
            _quantization = _quantization.setPrecision(precision);
        } else if (attribute == rounding) {
            Rounding r = Rounding.getName(rounding.getExpression());
            _quantization = _quantization.setRounding(r);
        } else if (attribute == overflow) {
View Full Code Here

                    .getElementAt(0, 1));
            _quantization = _quantization.setPrecision(precision);
            if (_quantization.getOverflow() == Overflow.GROW) {
                output.setTypeEquals(BaseType.UNSIZED_FIX);
            } else {
                output.setTypeEquals(new FixType(_quantization.getPrecision()));
            }
        } else if (attribute == rounding) {
            Rounding r = Rounding.getName(rounding.getExpression());
            _quantization = _quantization.setRounding(r);
        } else if (attribute == overflow) {
            Overflow o = Overflow.forName(overflow.getExpression());
            _quantization = _quantization.setOverflow(o);
            if (_quantization.getOverflow() == Overflow.GROW) {
                output.setTypeEquals(BaseType.UNSIZED_FIX);
            } else {
                output.setTypeEquals(new FixType(_quantization.getPrecision()));
            }
        } else {
            super.attributeChanged(attribute);
        }
    }
View Full Code Here

TOP

Related Classes of ptolemy.data.type.FixType

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.