Table.indexEntryPairs
get list of index/entry pairs
Calling Sequence
Description
Examples
List indexEntryPairs() throws MapleException
The indexEntryPairs function returns a List whose elements are Relation objects, each of which corresponds with a single index/entry pair from the Table.
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 );
Table tab = (Table)engine.evaluate( "table([a=1,b=2,c=3,d=2]):" );
System.out.println( "Size of table: " + 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: a, Value: 1
Key: b, Value: 2
Key: c, Value: 3
Key: d, Value: 2
See Also
ExternalCalling/Java/MapleException
OpenMaple
OpenMaple/Java/Algebraic
OpenMaple/Java/API
OpenMaple/Java/Table
OpenMaple/Java/Table/assign
OpenMaple/Java/Table/has
OpenMaple/Java/Table/select
Download Help Document