Package ptolemy.data.type

Examples of ptolemy.data.type.TypeConstant


            Token currentToken = getToken();

            if (currentToken != null) {
                Type currentType = currentToken.getType();

                TypeConstant current = new TypeConstant(currentType);
                Inequality ineq = new Inequality(current, getTypeTerm());
                result.add(ineq);
            }
        } catch (Exception e) {
            // Ignored: expression cannot be evaluated at this time.
            // do nothing.
        }

        // If the variable has a type, add a constraint.
        // Type currentType = getType();
        // if (currentType != BaseType.UNKNOWN) {
        //     TypeConstant current = new TypeConstant(currentType);
        //     Inequality ineq = new Inequality(current, getTypeTerm());
        //     result.add(ineq);
        // }
        // If an upper bound has been specified, add a constraint.
        if (_typeAtMost != BaseType.UNKNOWN) {
            TypeConstant atMost = new TypeConstant(_typeAtMost);
            Inequality ineq = new Inequality(getTypeTerm(), atMost);
            result.add(ineq);
        }

        return result;
View Full Code Here


     *  repeats the relative type constraints that were specified in
     *  the constructor.
     */
    public void setTypeAtMost(Type type) {
        Inequality inequality = new Inequality(this.getTypeTerm(),
                new TypeConstant(type));
        _constraints.add(inequality);
    }
View Full Code Here

        }

        public InequalityTerm getTypeTerm(String name)
                throws IllegalActionException {
            if (name.equals("time")) {
                return new TypeConstant(BaseType.DOUBLE);
            } else if (name.equals("iteration")) {
                return new TypeConstant(BaseType.INT);
            }

            if (_nameToType.containsKey(name)) {
                return new TypeConstant((ptolemy.data.type.Type) _nameToType
                        .get(name));
            }

            Variable result = getScopedVariable(null, _entity, name);
View Full Code Here

         *  exists with the given name, but cannot be evaluated.
         */
        public ptolemy.graph.InequalityTerm getTypeTerm(String name)
                throws IllegalActionException {
            if (name.equals("time")) {
                return new TypeConstant(BaseType.DOUBLE);
            } else if (name.equals("iteration")) {
                return new TypeConstant(BaseType.INT);
            }

            // Check the port names.
            TypedIOPort port = (TypedIOPort) _actor.getPort(name);

View Full Code Here

         *  exists with the given name, but cannot be evaluated.
         */
        public ptolemy.graph.InequalityTerm getTypeTerm(String name)
                throws IllegalActionException {
            if (name.equals("time")) {
                return new TypeConstant(BaseType.DOUBLE);
            } else if (name.equals("iteration")) {
                return new TypeConstant(BaseType.INT);
            }

            // Check the port names.
            TypedIOPort port = (TypedIOPort) getPort(name);

View Full Code Here

                Type type = (Type) map.get(name);

                if ((type == null) && (currentScope != null)) {
                    return currentScope.getTypeTerm(name);
                } else {
                    return new TypeConstant(type);
                }
            }

            public Set identifierSet() throws IllegalActionException {
                Set set = currentScope.identifierSet();
View Full Code Here

        ptolemy.data.Token value = (ptolemy.data.Token) _map.get(name);

        if (value == null) {
            return null;
        } else {
            return new TypeConstant(value.getType());
        }
    }
View Full Code Here

TOP

Related Classes of ptolemy.data.type.TypeConstant

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.