Package ptolemy.data

Examples of ptolemy.data.Token


     *  a delayed time stamp value.
     * @exception IllegalActionException If there is an error when
     *  sending the output token or setting the current time.
     */
    public void fire() throws IllegalActionException {
        Token token = _getNextInput();
        boolean delayNullVal = ((BooleanToken) nullDelay.getToken())
                .booleanValue();
        boolean delayRealVal = ((BooleanToken) realDelay.getToken())
                .booleanValue();
        Thread thread = Thread.currentThread();
View Full Code Here


        Receiver[][] receivers = output.getRemoteReceivers();

        for (int i = 0; i < receivers.length; i++) {
            for (int j = 0; j < receivers[i].length; j++) {
                DDEReceiver receiver = (DDEReceiver) receivers[i][j];
                receiver.put(new Token(), new Time(getDirector(),
                        PrioritizedTimedQueue.IGNORE));
            }
        }

        receivers = input.getReceivers();
View Full Code Here

        for (int i = 0; i < input.getWidth(); i++) {
            inRange = inRange || (i == _channel);

            if (input.hasToken(i)) {
                Token token = input.get(i);

                if (i == _channel) {
                    output.send(0, token);
                }
            }
View Full Code Here

            return false;
        }

        if (attribute instanceof Parameter) {
            try {
                Token token = ((Parameter) attribute).getToken();

                if (token instanceof BooleanToken) {
                    if (!((BooleanToken) token).booleanValue()) {
                        return false;
                    }
View Full Code Here

        // Add the inequality to the result list directly to add the
        // constraint only for this round of type resolution. If using
        // setTypeAtLeast(), the constraint will be permanent for this
        // Variable.
        try {
            Token currentToken = getToken();

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

                TypeConstant current = new TypeConstant(currentType);
                Inequality ineq = new Inequality(current, getTypeTerm());
                result.add(ineq);
            }
View Full Code Here

            if (_parserScope == null) {
                _parserScope = new VariableScope();
            }

            Token result = _parseTreeEvaluator.evaluateParseTree(_parseTree,
                    _parserScope);
            _setTokenAndNotify(result);
        } catch (IllegalActionException ex) {
            _needsEvaluation = true;
            throw new IllegalActionException(this, ex,
View Full Code Here

     *   to set to null a variable that has value dependents.
     */
    protected void _setTokenAndNotify(Token newToken)
            throws IllegalActionException {
        // Save to restore in case the change is rejected.
        Token oldToken = _token;
        Type oldVarType = _varType;

        if (_varType instanceof StructuredType) {
            try {
                oldVarType = (Type) ((StructuredType) _varType).clone();
            } catch (CloneNotSupportedException ex2) {
                throw new InternalErrorException(
                        "Variable._setTokenAndNotify: "
                                + " Cannot clone _varType" + ex2.getMessage());
            }
        }

        boolean oldNoTokenYet = _noTokenYet;
        String oldInitialExpression = _initialExpression;
        Token oldInitialToken = _initialToken;

        try {
            _setToken(newToken);

            NamedObj container = getContainer();
View Full Code Here

        int width = input.getWidth();
        Token[] record = new Token[width];

        for (int i = 0; i < width; i++) {
            if (input.hasToken(i)) {
                Token token = input.get(i);
                record[i] = token;
                _count++;
            }
        }
View Full Code Here

                    .getToken()).booleanValue();

            if (!allowDuplicatesValue) {
                // Strip out duplicates.
                ArrayList list = new ArrayList();
                Token previous = result.getElement(0);
                list.add(previous);

                for (int i = 1; i < result.length(); i++) {
                    Token next = result.getElement(i);

                    if (!next.isEqualTo(previous).booleanValue()) {
                        list.add(next);
                        previous = next;
                    }
                }
View Full Code Here

            }

            return true;
        }

        Token referenceToken = ((ArrayToken) (correctValues.getToken()))
                .getElement(_numberOfInputTokensSeen);

        if (input.hasToken(0)) {
            Token token = input.get(0);
            _numberOfInputTokensSeen++;

            // FIXME: If we get a nil token on the input, what should we do?
            // Here, we require that the referenceToken also be nil.
            // If the token is an ArrayToken and two corresponding elements
            // are nil, then we consider them "close".
            if (token.isCloseTo(referenceToken, _tolerance).booleanValue() == false
                    && !referenceToken.isNil()
                    && !_isCloseToIfNilArrayElement(token, referenceToken,
                            _tolerance)
                    && !_isCloseToIfNilRecordElement(token, referenceToken,
                            _tolerance)) {
View Full Code Here

TOP

Related Classes of ptolemy.data.Token

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.