Examples of LongToken


Examples of ptolemy.data.LongToken

        output.outsideTransmitProperties.setExpression("{range=Infinity}");

        delay = new Parameter(this, "delay", new DoubleToken(1.0));
        delay.setTypeEquals(BaseType.DOUBLE);

        seed = new Parameter(this, "seed", new LongToken(0));
        seed.setTypeEquals(BaseType.LONG);

        doublePath = new Parameter(this, "doublePath", new LongToken(0));
        doublePath.setToken("false");
        doublePath.setTypeEquals(BaseType.BOOLEAN);

        _distance = new Variable(this, "distance");
        _distance.setExpression("Infinity");
View Full Code Here

Examples of ptolemy.data.LongToken

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

Examples of ptolemy.data.LongToken

        } else if (object instanceof Short) {
            returnValue = new ShortToken(((Short) object).shortValue());
        } else if (object instanceof Integer) {
            returnValue = new IntToken(((Integer) object).intValue());
        } else if (object instanceof Long) {
            returnValue = new LongToken(((Long) object).longValue());
        } else if (object instanceof Double) {
            returnValue = new DoubleToken(((Double) object).doubleValue());
        } else if (object instanceof Float) {
            returnValue = new FloatToken(((Float) object).floatValue());
        } else if (object instanceof Complex) {
            returnValue = new ComplexToken((Complex) object);
        } else if (object instanceof FixPoint) {
            returnValue = new FixToken((FixPoint) object);
        } else if (object instanceof String) {
            returnValue = new StringToken((String) object);
        } else if (object instanceof boolean[][]) {
            returnValue = new BooleanMatrixToken((boolean[][]) object);
        } else if (object instanceof int[][]) {
            returnValue = new IntMatrixToken((int[][]) object);
        } else if (object instanceof long[][]) {
            returnValue = new LongMatrixToken((long[][]) object);
        } else if (object instanceof double[][]) {
            returnValue = new DoubleMatrixToken((double[][]) object);
        } else if (object instanceof Complex[][]) {
            returnValue = new ComplexMatrixToken((Complex[][]) object);
        } else if (object instanceof FixPoint[][]) {
            returnValue = new FixMatrixToken((FixPoint[][]) object);
        } else if (object instanceof double[]) {
            DoubleToken[] temp = new DoubleToken[((double[]) object).length];

            for (int j = 0; j < temp.length; j++) {
                temp[j] = new DoubleToken(((double[]) object)[j]);
            }

            returnValue = new ArrayToken(temp);
        } else if (object instanceof Complex[]) {
            ComplexToken[] temp = new ComplexToken[((Complex[]) object).length];

            for (int j = 0; j < temp.length; j++) {
                temp[j] = new ComplexToken(((Complex[]) object)[j]);
            }

            returnValue = new ArrayToken(temp);
        } else if (object instanceof int[]) {
            IntToken[] temp = new IntToken[((int[]) object).length];

            for (int j = 0; j < temp.length; j++) {
                temp[j] = new IntToken(((int[]) object)[j]);
            }

            returnValue = new ArrayToken(temp);
        } else if (object instanceof long[]) {
            LongToken[] temp = new LongToken[((long[]) object).length];

            for (int j = 0; j < temp.length; j++) {
                temp[j] = new LongToken(((long[]) object)[j]);
            }

            returnValue = new ArrayToken(temp);
        } else if (object instanceof boolean[]) {
            BooleanToken[] temp = new BooleanToken[((boolean[]) object).length];
View Full Code Here

Examples of ptolemy.data.LongToken

     *  may change this value.
     *  @return The approximate number of bytes available.
     *  @see #totalMemory()
     */
    public static LongToken freeMemory() {
        return new LongToken(Runtime.getRuntime().freeMemory());
    }
View Full Code Here

Examples of ptolemy.data.LongToken

     *  and available for future object allocation.
     *  @return The total number of bytes used by the JVM.
     *  @see #freeMemory()
     */
    public static LongToken totalMemory() {
        return new LongToken(Runtime.getRuntime().totalMemory());
    }
View Full Code Here

Examples of ptolemy.data.LongToken

     *  value.
     *  @exception IllegalActionException If there is no director.
     */
    public void fire() throws IllegalActionException {
        super.fire();
        LongToken inputToken = (LongToken) input.get(0);
        Long inputValue = Long.valueOf(inputToken.longValue());
        DoubleToken result = new DoubleToken(inputValue.doubleValue());

        output.send(0, result);
    }
View Full Code Here

Examples of ptolemy.data.LongToken

        } else if (result instanceof Double) {
            resultToken = new DoubleToken(((Double) result).doubleValue());
        } else if (result instanceof Integer) {
            resultToken = new IntToken(((Integer) result).intValue());
        } else if (result instanceof Long) {
            resultToken = new LongToken(((Long) result).longValue());
        } else if (result instanceof String) {
            resultToken = new StringToken((String) result);
        } else if (result instanceof Boolean) {
            resultToken = new BooleanToken(((Boolean) result).booleanValue());
        } else if (result instanceof Complex) {
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.