return the number of elements stored in the RTable - Maple Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Programming : OpenMaple : Java Application Programming Interface : RTable Class : OpenMaple/Java/RTable/numElements

RTable.numElements - return the number of elements stored in the RTable

Calling Sequence

int numElements( ) throws MapleException



The numElements function returns the number of elements stored within the RTable.


import com.maplesoft.openmaple.*;

import com.maplesoft.externalcall.MapleException;

class Example


    public static void main( String notused[] ) throws MapleException


    String mapleArgs[];

    Engine engine;

    RTable a;

    int index[];

    Numeric one;

    int n, i;

    mapleArgs = new String[1];

    mapleArgs[0] = "java";

    engine = new Engine( mapleArgs, new EngineCallBacksDefault(),

        null, null );

    a = (RTable)engine.evaluate( "Array( 1..3, 1..3, (i,j)->(i*j)+1 ):" );

    n = a.numElements();

    System.out.println( "Number of elements: "+n );

    a = (RTable)engine.evaluate( "Array( 10..30, 13..15, 11..17, (i,j)->(i*j)+1 ):" );

    n = a.numElements();

    System.out.println( "Number of elements: "+n );



Executing this code produces the following output.

Number of elements: 9

Number of elements: 441

See Also

ExternalCalling/Java/MapleException, OpenMaple, OpenMaple/Java/API, OpenMaple/Java/RTable

Download Help Document

Was this information helpful?

Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam