Package ptolemy.data

Examples of ptolemy.data.IntToken.intValue()


     */
    public void attributeChanged(Attribute attribute)
            throws IllegalActionException {
        if (attribute == blockSize) {
            IntToken blockSizeToken = (IntToken) (blockSize.getToken());
            _blockSizeValue = blockSizeToken.intValue();

            if (_blockSizeValue < 1) {
                throw new IllegalActionException(this, "Invalid blockSize: "
                        + _blockSizeValue);
            }
View Full Code Here


     */
    public void attributeChanged(Attribute attribute)
            throws IllegalActionException {
        if (attribute == maxPrecision) {
            IntToken intToken = (IntToken) maxPrecision.getToken();
            int intValue = intToken.intValue();
            if (intValue == 0) {
                // If the precision is 0, use maximum precision
                // allowed by double.
                _mathContext = null;
            } else if (intValue > 0) {
View Full Code Here

                _mathContext = null;
            } else if (intValue > 0) {
                // If the precision is > 0, create a MathContext with
                // the specified precision (to be used with a
                // BigDecimal for rounding purposes).
                _mathContext = new MathContext(intToken.intValue());
            } else {
                throw new IllegalActionException(this,
                        "Precision must be an integer "
                                + "greater than or equal to 0.");
            }
View Full Code Here

     */
    public void attributeChanged(Attribute attribute)
            throws IllegalActionException {
        if (attribute == blockSize) {
            IntToken blockSizeToken = (IntToken) (blockSize.getToken());
            _blockSizeValue = blockSizeToken.intValue();

            if (_blockSizeValue < 1) {
                throw new IllegalActionException(this, "Invalid blockSize: "
                        + _blockSizeValue);
            }
View Full Code Here

            DoubleToken time = (DoubleToken) inputToken.get("time");
            IntToken d = (IntToken) inputToken.get("depth");

            if ((time.doubleValue() > _timeValue)
                    || ((time.doubleValue() == _timeValue) && (d.intValue() < _parentDepth))) {
                //the root node may have been changed
                //or there is a shorter path.
                ArrayToken locationArray = (ArrayToken) inputToken
                        .get("location");
                int length = locationArray.length();
View Full Code Here

                    _parentLocation[i] = ((DoubleToken) locationArray
                            .getElement(i)).doubleValue();
                }

                _timeValue = time.doubleValue();
                _parentDepth = d.intValue();

                _speed = _getSpeed();
            }
        }
    }
View Full Code Here

            DoubleToken time = (DoubleToken) inputToken.get("time");
            IntToken d = (IntToken) inputToken.get("depth");

            if ((time.doubleValue() > _timeValue)
                    || ((time.doubleValue() == _timeValue) && (d.intValue() < _parentDepth))) {
                //the root node may have been changed
                //or there is a shorter path.
                ArrayToken locationArray = (ArrayToken) inputToken
                        .get("location");
                int length = locationArray.length();
View Full Code Here

                    _parentLocation[i] = (DoubleToken) locationArray
                            .getElement(i);
                }

                _timeValue = time.doubleValue();
                _parentDepth = d.intValue();

                String[] labels = { "location", "time", "depth" };

                Token[] values = { new ArrayToken(_parentLocation),
                        new DoubleToken(_timeValue), new IntToken(_parentDepth) };
View Full Code Here

        if (attribute instanceof Parameter
                && "width".equals(attribute.getName())) {
            IntToken t = (IntToken) ((Parameter) attribute).getToken();

            if (t != null) {
                int width = t.intValue();
                _setWidth(width);
            }
        }
    }
View Full Code Here

                // Try to create a new [int] type with just one member.
                // The following conversion will fail if the member cannot
                // be converted to an int.
                IntToken singleMember = IntToken.convert(token);
                int[] matrix = new int[1];
                matrix[0] = singleMember.intValue();
                return new IntMatrixToken(matrix, 1, 1);
            }
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.