Package ptolemy.data.type

Examples of ptolemy.data.type.Type


        /** Return the function result.
         *  @return A Type.
         */
        public Object getValue() {
            Type inputType = input.getType();
            Type tapsElementType = BaseType.UNKNOWN;
            if (taps.getType() != BaseType.UNKNOWN) {
                tapsElementType = ((ArrayType) taps.getType()).getElementType();
            }
            Type productType = inputType.multiply(tapsElementType);
            Type outputType = productType;

            int phaseLength = _taps.length / _interpolationValue;

            if ((_taps.length % _interpolationValue) != 0) {
                phaseLength++;
            }
            for (int i = 0; i < phaseLength; i++) {
                outputType = outputType.add(productType);
            }
            return outputType;
        }
View Full Code Here


                    FSMActor fsmActor = (FSMActor) getContainer()
                            .getContainer();
                    _scope = fsmActor.getPortScope();
                }

                Type type = _typeInference.inferTypes(parseTree, _scope);
                return type;
            } catch (Exception ex) {
                throw new IllegalActionException(AbstractActionsAttribute.this,
                        ex,
                        "An error occurred during expression type inference");
View Full Code Here

        /** Return the function result.
         *  @return A Type.
         */
        public Object getValue() {
            Type type1 = _port1.getType();
            Type type2 = _port2.getType();

            if ((type1 == BaseType.UNKNOWN) || (type2 == BaseType.UNKNOWN)) {
                return BaseType.UNKNOWN;
            } else if ((type1 instanceof ArrayType)
                    && (type2 instanceof ArrayType)) {
                Type elType1 = ((ArrayType) type1).getElementType();
                Type elType2 = ((ArrayType) type2).getElementType();
                CPO lattice = TypeLattice.lattice();
                return lattice.leastUpperBound(elType1, elType2);
            } else if ((type1 instanceof MatrixType)
                    && (type2 instanceof MatrixType)) {
                Type elType1 = ((MatrixType) type1).getElementType();
                Type elType2 = ((MatrixType) type2).getElementType();
                CPO lattice = TypeLattice.lattice();
                return lattice.leastUpperBound(elType1, elType2);
            } else {
                return BaseType.UNKNOWN;
            }
View Full Code Here

        /** Return the function result.
         *  @return A Type.
         */
        public Object getValue() {
            Type inputType = _port.getType();

            if (inputType == BaseType.INT) {
                return BaseType.DOUBLE;
            } else if (inputType == BaseType.INT_MATRIX) {
                return BaseType.DOUBLE_MATRIX;
View Full Code Here

         @return An array type for the associated typeable.
         *  @exception IllegalActionException If the type of the typeable
         *   cannot be determined.
         */
        private ArrayType _getArrayTypeRaw() throws IllegalActionException {
            Type type = input.getType();
            if (_arrayType == null || !_arrayType.getElementType().equals(type)) {
                _arrayType = new ArrayType(type);
            }
            return _arrayType;
        }
View Full Code Here

         @exception IllegalActionException If the type of the typeable
         *   cannot be determined.
         */
        private ArrayType _getArrayTypeRaw(int length)
                throws IllegalActionException {
            Type type = input.getType();
            if (_arrayType == null || !_arrayType.getElementType().equals(type)) {
                _arrayType = new ArrayType(type, length);
            }
            return _arrayType;
        }
View Full Code Here

        resetOnEachRun = new Parameter(this, "resetOnEachRun");
        resetOnEachRun.setExpression("true");

        range = new Parameter(this, "range");

        Type rangeType = new ArrayType(new ArrayType(BaseType.DOUBLE));
        range.setTypeEquals(rangeType);
        range.setExpression("{{0.0, 500.0}, {0.0, 500.0}}");

        seed = new Parameter(this, "seed");
        seed.setExpression("0L");
View Full Code Here

        /** Return the function result.
         *  @return A Type.
         */
        public Object getValue() {
            Type inputType = _port.getType();

            if (!(inputType instanceof MatrixType)) {
                return BaseType.UNKNOWN;
            }

View Full Code Here

                    // We need to explicit return an ArrayType here
                    // because the port type may not be an ArrayType.
                    String portName = name.substring(0, name.length() - 5);
                    if (port == _identifierToPort.get(portName)) {
                        Type portType = ((Typeable) port).getType();
                        return new ArrayType(portType);
                    }
                }
                return ((Typeable) port).getType();
            }
View Full Code Here

     *   to this container.
     */
    public void attributeChanged(Attribute attribute)
            throws IllegalActionException {
        if (attribute instanceof TypeAttribute) {
            Type type = ((TypeAttribute) attribute).getType();

            if (type != null) {
                // Avoid incrementing the workspace version if the type has
                // not changed.
                if (!type.equals(_declaredType) || !type.equals(_resolvedType)) {
                    setTypeEquals(type);
                }
            }
        } else {
            super.attributeChanged(attribute);
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.