Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
Table.has - check if a key is associated with an element in the Table
Calling Sequence
boolean has( Algebraic key ) throws MapleException
Parameters
key
-
index to check
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.
true
false
See Also
ExternalCalling/Java/MapleException, OpenMaple, OpenMaple/Java/Algebraic, OpenMaple/Java/API, OpenMaple/Java/Table, OpenMaple/Java/Table/assign, OpenMaple/Java/Table/remove, OpenMaple/Java/Table/select
Download Help Document