Table.keySet
get Set view of keys in the Table
Table.entrySet
get Set view of key/value pairs in the Table
Calling Sequence
Parameters
Description
Examples
java.util.Set<Algebraic> keySet( )
java.util.Set<Map.Entry<Algebraic,Algebraic>> entrySet( )
key
-
index to check
The keySet function returns a java.util.Set view of the keys in the Table.
The entrySet function returns a java.util.Set of Map.Entry objects, each representing a key/value pair in 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 t = (Table)engine.evaluate( "table([1=100,2=200,3=300,4=400]):" );
for (Algebraic e : t.keySet()) {
System.out.println( "Key: " + e );
}
Executing this code produces the following output.
true
false
See Also
ExternalCalling/Java/MapleException
OpenMaple
OpenMaple/Java/Algebraic
OpenMaple/Java/API
OpenMaple/Java/Table
OpenMaple/Java/Table/assign
OpenMaple/Java/Table/clear
OpenMaple/Java/Table/remove
OpenMaple/Java/Table/select
OpenMaple/Java/Table/values
Download Help Document