get - Maple Help

List.get

return an element stored within a list

 Calling Sequence Algebraic get( int i )

Parameters

 i - index of the entry to return

Description

 • The get function returns the Algebraic object stored in index i of the List.
 • The index i is zero-based; valid values of i are $0..n-1$ where $n$ is the length of the list.  The length can be obtained by calling numElements.
 • This is identical to select except that its index is zero-based and does not throw a MapleException.

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 ); List l = (List)engine.evaluate( "[1, 4, 7]" ); for (int i = 0; i < l.numelems(l); i++) { System.out.println( "Element: " + l.get(i) ); } }

Executing this code produces the following output.

 Element: 1 Element: 4 Element: 7