Table.unassign
remove the element associated with a key
Calling Sequence
Parameters
Description
Examples
void unassign( Algebraic key ) throws MapleException
key
-
index of the element to access
The unassign function unassigns the Algebraic object associated with key from the Table. If no element is associated with key, no error is raised.
This function is identical to unassign except that it throws a MapleException.
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]):" );
Numeric n = engine.newNumeric( 1 );
System.out.println( t.has( n ) );
t.unassign( n );
n = engine.newNumeric( 2 );
n = engine.newNumeric( 3 );
t.unassign( engine.newNumeric( 10 ) );
}
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/has
OpenMaple/Java/Table/remove
OpenMaple/Java/Table/select
Download Help Document