Package ptolemy.actor

Examples of ptolemy.actor.NoTokenException


     @return A token.
     *  @exception NoTokenException Not thrown in this base class.
     */
    public synchronized Token get() throws NoTokenException {
        if (_tokens.isEmpty()) {
            throw new NoTokenException(getContainer(),
                    "No more tokens in the TM receiver.");
        }

        return (Token) _tokens.removeFirst();
    }
View Full Code Here


     @exception NoTokenException If there is no token in the receiver.
     */
    public Token get() {
        if (_queue.isEmpty()) {
            // The queue is empty.
            throw new NoTokenException(getContainer(),
                    "Attempt to get token from an empty QueueReceiver.");
        }

        return (Token) _queue.take();
    }
View Full Code Here

     */
    public Token get(int offset) {
        try {
            return (Token) _queue.get(offset);
        } catch (NoSuchElementException ex) {
            throw new NoTokenException(getContainer(), "Offset " + offset
                    + " out of range with " + _queue.size()
                    + " tokens in the receiver and " + _queue.historySize()
                    + " in history.");
        }
    }
View Full Code Here

        // local time parameters
        Token token = null;
        Event event = (Event) _queue.take();

        if (event == null) {
            throw new NoTokenException(getContainer(),
                    "Attempt to get token from an empty "
                            + "PrioritizedTimedQueue.");
        }

        token = event.getToken();
View Full Code Here

        // Get the token and set all relevant
        // local time parameters
        Event event = (Event) _queue.take();

        if (event == null) {
            throw new NoTokenException(getContainer(),
                    "Attempt to get token from an empty "
                            + "PrioritizedTimedQueue.");
        }

        event.getToken();
View Full Code Here

     @return The token contained by this receiver.
     *  @exception NoTokenException If there is no token.
     */
    public Token get() {
        if (!_hasTokenCache) {
            throw new NoTokenException(getContainer(),
                    "Attempt to get token that does not have "
                            + "have the earliest time stamp.");
        }

        synchronized (_director) {
View Full Code Here

     @exception NoTokenException If there are no more tokens. This is
     *   a runtime exception, so it need not to be declared explicitly.
     */
    public Token get() throws NoTokenException {
        if (_tokens.isEmpty()) {
            throw new NoTokenException(getContainer(),
                    "No more tokens in the DE receiver.");
        }

        return (Token) _tokens.removeFirst();
    }
View Full Code Here

                throw new InvalidStateException(getContainer(),
                        "get() is called before the signal type of this port"
                                + " has been set. Bug in CTScheduler?");
            }
        } else {
            throw new NoTokenException(getContainer(),
                    "Attempt to get data from an empty CTReceiver.\n"
                            + "Are you trying to use a discrete signal "
                            + "to drive a continuous port?");
        }
    }
View Full Code Here

            throw new InvalidStateException(
                    "FixedPointReceiver: get() called on an "
                            + "FixedPointReceiver " + "with status unknown.");
        }
        if (_token == null) {
            throw new NoTokenException(
                    "FixedPointReceiver: Attempt to get data from an "
                            + "empty receiver.");
        }
        return _token;
    }
View Full Code Here

     @return A token from this receiver.
     *  @exception ptolemy.actor.NoTokenException If there is no token.
     */
    public synchronized Token get() throws NoTokenException {
        if (_tokens.size() == 0) {
            throw new NoTokenException(getContainer(),
                    "No more tokens in the CI receiver.");
        }

        return (Token) _tokens.removeFirst();
    }
View Full Code Here

TOP

Related Classes of ptolemy.actor.NoTokenException

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.