Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.IllegalActionException


        super.fire();
        int currentIndex = 0;
        ArrayToken val = (ArrayToken)values.getToken();
        if (_indexColCount < _indexes.length) {
            if (val.length() != _indexes.length) {
                throw new IllegalActionException(this, "Parameters values and indexes have " + "different lengths.  Length of values = " + val.length()+". Length of indexes = "+_indexes.length+".");
            }
            currentIndex = _indexes[_indexColCount];
            if (_iterationCount == currentIndex) {
                output.send(0, val.getElement(_indexColCount));
                $ASSIGN$_match(true);
View Full Code Here


     *   @see #getContainer()
     */
    public void setContainer(NamedObj container) throws IllegalActionException,
            NameDuplicationException {
        if ((container != null) && (_workspace != container.workspace())) {
            throw new IllegalActionException(this, container,
                    "Cannot set container because workspaces are different.");
        }

        try {
            _workspace.getWriteAccess();
View Full Code Here

     *   an acceptable class.  Not thrown in this base class.
     */
    protected void _checkContainer(NamedObj container)
            throws IllegalActionException {
        if (!(container instanceof GenericJNIActor)) {
            throw new IllegalActionException(this, container,
                    "Cannot place arguments on entities "
                            + container.getClass().getName()
                            + ", which are not GenericJNIActor.");
        }
    }
View Full Code Here

            if (lowerBoundValue instanceof ScalarToken) {
                if (((ScalarToken)lowerBoundValue).isGreaterThan((ScalarToken)_latestSum).booleanValue()) {
                    $ASSIGN$_latestSum(lowerBoundValue);
                }
            } else {
                throw new IllegalActionException(this, "lowerBound parameter only works with scalar values. Value given was: " + lowerBoundValue);
            }
        }
        Token upperBoundValue = upperBound.getToken();
        if (upperBoundValue != null) {
            if (upperBoundValue instanceof ScalarToken) {
                if (((ScalarToken)upperBoundValue).isLessThan((ScalarToken)_latestSum).booleanValue()) {
                    $ASSIGN$_latestSum(upperBoundValue);
                }
            } else {
                throw new IllegalActionException(this, "upperBound parameter only works with scalar values. Value given was: " + upperBoundValue);
            }
        }
        output.broadcast(_latestSum);
    }
View Full Code Here

     *   container with the same name.
     */
    public void setContainer(NamedObj container) throws IllegalActionException,
            NameDuplicationException {
        if ((container != null) && !(container instanceof CompositeEntity)) {
            throw new IllegalActionException(this, container,
                    "CodeGenerator can only be contained"
                            + " by CompositeEntity");
        }

        super.setContainer(container);
View Full Code Here

            $ASSIGN$_minimumValue(((DoubleToken)minimumValue.getToken()).doubleValue());
            $ASSIGN$_maximumValue(((DoubleToken)maximumValue.getToken()).doubleValue());
            $ASSIGN$_numberOfBins(((IntToken)numberOfBins.getToken()).intValue());
            double width = (_maximumValue - _minimumValue) / _numberOfBins;
            if (width <= 0.0) {
                throw new IllegalActionException(this, "Invalid bin width (must be positive): " + width);
            }
            $ASSIGN$_binWidth(width);
            $ASSIGN$_bins(new int[_numberOfBins]);
        } else {
            super.attributeChanged(attribute);
View Full Code Here

                    output.send(0, token);
                }
            }
        }
        if (!inRange) {
            throw new IllegalActionException(this, "Select input is out of range: " + _channel+".");
        }
    }
View Full Code Here

     */
    public void attributeChanged(Attribute attribute) throws IllegalActionException  {
        if (attribute == meanTime) {
            double mean = ((DoubleToken)meanTime.getToken()).doubleValue();
            if (mean <= 0.0) {
                throw new IllegalActionException(this, "meanTime is required to be positive.  meanTime given: " + mean);
            }
        } else if (attribute == values) {
            ArrayToken val = (ArrayToken)(values.getToken());
            $ASSIGN$_length(val.length());
        } else {
View Full Code Here

    }

    private Token _getValue(int index) throws IllegalActionException  {
        ArrayToken val = (ArrayToken)(values.getToken());
        if ((val == null) || (index >= _length)) {
            throw new IllegalActionException(this, "Index out of range of the values parameter.");
        }
        return val.getElement(index);
    }
View Full Code Here

            $ASSIGN$_indexes(new int[indexesValue.length()]);
            int previous = 0;
            for (int i = 0; i < indexesValue.length(); i++) {
                $ASSIGN$_indexes(i, ((IntToken)indexesValue.getElement(i)).intValue());
                if (_indexes[i] < previous) {
                    throw new IllegalActionException(this, "Value of indexes is not nondecreasing " + "and nonnegative.");
                }
                previous = _indexes[i];
            }
            _interpolation.setIndexes($BACKUP$_indexes());
        } else if (attribute == period) {
View Full Code Here

TOP

Related Classes of ptolemy.kernel.util.IllegalActionException

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.