Table.has - check if a key is associated with an element in the Table
|
Calling Sequence
|
|
boolean has( Algebraic key ) throws MapleException
|
|
Description
|
|
•
|
The has function returns true if the Algebraic object key is associated with an element in the Table. If key is not used, false is returned.
|
|
|
Examples
|
|
import com.maplesoft.openmaple.*;
|
import com.maplesoft.externalcall.MapleException;
|
class Example
|
{
|
public static void main( String notused[] ) throws MapleException
|
{
|
String mapleArgs[];
|
Engine engine;
|
Table t;
|
mapleArgs = new String[1];
|
mapleArgs[0] = "java";
|
engine = new Engine( mapleArgs, new EngineCallBacksDefault(),
|
null, null );
|
t = (Table)engine.evaluate( "table([(1)=100,(2)=200,(3)=300,(4)=400]):" );
|
System.out.println( t.has( engine.newNumeric( 1 ) ) );
|
System.out.println( t.has( engine.newNumeric( 2 ) ) );
|
System.out.println( t.has( engine.newNumeric( 5 ) ) );
|
System.out.println( t.has( engine.newNumeric( 6 ) ) );
|
}
|
}
|
|
|
Executing this code produces the following output.
|
|
Download Help Document
Was this information helpful?