Package ptolemy.caltrop

Examples of ptolemy.caltrop.CalIOException


        }

        try {
            //            System.out.println("Attempting to read " + n + " tokens from port with rate = " + ptolemy.actor.util.DFUtilities.getTokenConsumptionRate(port));
            if (!port.hasToken(channel, m)) {
                throw new CalIOException("Insufficient number of tokens.");
            }

            for (int i = 0; i < m; i++) {
                buffer.add(port.get(channel));
            }

            tokensRead = Math.max(tokensRead, n + 1);
            return buffer.get(n);
        } catch (IllegalActionException e) {
            throw new CalIOException("Could not read tokens.", e);
        }
    }
View Full Code Here


                return port.hasToken(channel, m);
            } else {
                return n == 0;
            }
        } catch (IllegalActionException ex) {
            throw new CalIOException("Could not test for presence of tokens.",
                    ex);
        }
    }
View Full Code Here

     */
    public void put(Object a) {
        try {
            port.send(channel, (Token) a);
        } catch (IllegalActionException ex) {
            throw new CalIOException("Could not send token.", ex);
        } catch (NoRoomException ex) {
            throw new CalIOException("No room for sending token.", ex);
        } catch (ClassCastException ex) {
            throw new CalIOException("Token not of valid token type.", ex);
        }
    }
View Full Code Here

TOP

Related Classes of ptolemy.caltrop.CalIOException

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.