indexEntryPairs - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


RTable.indexEntryPairs

get list of index/entry pairs

 

Calling Sequence

Description

Examples

Calling Sequence

List indexEntryPairs() throws MapleException

Description

• 

The indexEntryPairs function returns a List whose elements are Relation objects, each of which corresponds with a single index/entry pair from the RTable.

Examples

import com.maplesoft.openmaple.*;

import com.maplesoft.externalcall.MapleException;

class Example

{

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

    {

        String[] mapleArgs = { "java" };

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

        RTable tab = (RTable)engine.evaluate( "Array([1,2,3,2]):" );

        System.out.println( "Size of rtable: " + tab.numElements() );

        List pairlist = tab.indexEntryPairs();

        for (Algebraic elem : pairlist) {

              Relation pair = (Relation)elem;

            System.out.println( "Key: " + pair.lhs() + ", Value: " + pair.rhs() );

        }

}

Executing this code produces the following output.

Size of table: 4

Key: 1, Value: 1

Key: 2, Value: 2

Key: 3, Value: 3

Key: 4, Value: 2

See Also

ExternalCalling/Java/MapleException

OpenMaple

OpenMaple/Java/Algebraic

OpenMaple/Java/API

OpenMaple/Java/RTable

OpenMaple/Java/RTable/assign

OpenMaple/Java/RTable/has

OpenMaple/Java/RTable/select