Package ptolemy.data.type

Examples of ptolemy.data.type.ArrayType$ElementTypeTerm


    public static Type sortReturnType(Type type) {
        // NOTE: This logic indicates which tokens are comparable
        // by the TokenComparator inner class. If that class is changed,
        // then this logic needs to be changed too.
        if (type instanceof ArrayType) {
            ArrayType arrayType = (ArrayType) type;
            Type elementType = arrayType.getElementType();

            if (elementType.equals(BaseType.COMPLEX)) {
                return BaseType.UNKNOWN;
            } else if (elementType.equals(BaseType.STRING)
                    || BaseType.SCALAR.isCompatible(elementType)) {
View Full Code Here


     @param type The type of the argument to the corresponding function.
     *  @return The type of the value returned from the corresponding function.
     */
    public static Type sumReturnType(Type type) {
        if (type instanceof ArrayType) {
            ArrayType arrayType = (ArrayType) type;
            return arrayType.getElementType();
        } else {
            return BaseType.UNKNOWN;
        }
    }
View Full Code Here

        // Interpolation class. This is not required for this class to
        // function. But since these parameters are public, other objects
        // in the system may use them.
        indexes = new Parameter(this, "indexes");
        indexes.setExpression("{0, 1}");
        indexes.setTypeEquals(new ArrayType(BaseType.INT));

        // Call this so that we don't have to copy its code here...
        attributeChanged(indexes);

        // set values parameter
        values = new Parameter(this, "values");
        values.setExpression("{1.0, 0.0}");
        values.setTypeEquals(new ArrayType(BaseType.DOUBLE));

        int defOrder = _interpolation.getOrder();
        IntToken defOrderToken = new IntToken(defOrder);
        order = new Parameter(this, "order", defOrderToken);
        order.setTypeEquals(BaseType.INT);
View Full Code Here

        uncodedRate = new Parameter(this, "uncodedRate");
        uncodedRate.setTypeEquals(BaseType.INT);
        uncodedRate.setExpression("1");

        polynomialArray = new Parameter(this, "polynomialArray");
        polynomialArray.setTypeEquals(new ArrayType(BaseType.INT));
        polynomialArray.setExpression("{05, 07}");

        delay = new Parameter(this, "delay");
        delay.setTypeEquals(BaseType.INT);
        delay.setExpression("10");

        softDecoding = new Parameter(this, "softDecoding");
        softDecoding.setExpression("false");
        softDecoding.setTypeEquals(BaseType.BOOLEAN);

        trellisDecoding = new Parameter(this, "trellisDecoding");
        trellisDecoding.setExpression("false");
        trellisDecoding.setTypeEquals(BaseType.BOOLEAN);
        trellisDecoding.setVisibility(Settable.NONE);

        constellation = new Parameter(this, "constellation");
        constellation.setTypeEquals(new ArrayType(BaseType.DOUBLE));
        constellation.setExpression("{-1.0, 1.0}");

        //mode = new StringAttribute(this, "mode");
        //mode.setExpression("Hard Decoding");
        //mode.setVisibility(Settable.NONE);
View Full Code Here

            // Set different input port types for soft and hard decoding.
            if (_trellisMode) {
                _mode = _TRELLIS;
                _type.setExpression("complex");
                constellation.setTypeEquals(new ArrayType(BaseType.COMPLEX));
            } else if (_softMode) {
                _mode = _SOFT;
                _type.setExpression("double");
                constellation.setTypeEquals(new ArrayType(BaseType.DOUBLE));
            } else {
                _mode = _HARD;
                _type.setExpression("boolean");
            }
        } else if (attribute == uncodedRate) {
View Full Code Here

     */
    public void visitArrayConstructNode(ASTPtArrayConstructNode node)
            throws IllegalActionException {
        Type[] childTypes = _inferAllChildren(node);

        _setType(node, new ArrayType((Type) TypeLattice.lattice()
                .leastUpperBound(childTypes), childTypes.length));
    }
View Full Code Here

                .setToken(BooleanToken.TRUE);
        (new SingletonParameter(peakIndices, "_showName"))
                .setToken(BooleanToken.TRUE);

        // Set Type Constraints.
        input.setTypeEquals(new ArrayType(BaseType.DOUBLE));
        peakValues.setTypeAtLeast(input);
        peakIndices.setTypeEquals(new ArrayType(BaseType.INT));

        // NOTE: Consider constraining input element types.
        // This is a bit complicated to do, however.
    }
View Full Code Here

     @exception CloneNotSupportedException If a derived class contains
     *   an attribute that cannot be cloned.
     */
    public Object clone(Workspace workspace) throws CloneNotSupportedException {
        ArrayPeakSearch newObject = (ArrayPeakSearch) super.clone(workspace);
        newObject.input.setTypeEquals(new ArrayType(BaseType.DOUBLE));
        newObject.peakValues.setTypeAtLeast(newObject.input);
        return newObject;
    }
View Full Code Here

            throws NameDuplicationException, IllegalActionException {
        super(container, name);

        input.setTypeEquals(BaseType.STRING);

        output.setTypeEquals(new ArrayType(BaseType.UNSIGNED_BYTE));
    }
View Full Code Here

    public static void main(String[] args) throws IllegalActionException {
        tokens = new Token[1];
        tokens[0] = intToken;
        arraytoken = new ArrayToken(tokens);

        if (arraytoken.getType().equals(new ArrayType(BaseType.INT))) {
            token = intToken;
        } else {
            token = arraytoken;
        }
View Full Code Here

TOP

Related Classes of ptolemy.data.type.ArrayType$ElementTypeTerm

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.