Set.iterator
return iterator over Set
Calling Sequence
Description
Examples
java.util.Iterator<Algebraic> iterator( )
The iterator function returns an Iterator object which can be used to iterate over the Set.
import java.util.Iterator;
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 );
Set s = (Set)engine.evaluate( "{2,7.5,5,8};" );
Iterator<Algebraic> it = s.iterator();
while (it.hasNext()) {
System.out.println( "Element: " + it.next() );
}
Executing this code produces the following output:
Element: 2
Element: 3
Element: 5
Element: 7.5
See Also
ExternalCalling/Java/MapleException
OpenMaple
OpenMaple/Java/Algebraic
OpenMaple/Java/API
OpenMaple/Java/Set
OpenMaple/Java/Set/contains
OpenMaple/Java/Set/containsAll
OpenMaple/Java/Set/select
OpenMaple/Java/Set/toArray
Download Help Document