iterator - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Set.iterator

return iterator over Set

 

Calling Sequence

Description

Examples

Calling Sequence

java.util.Iterator<Algebraic> iterator( )

Description

• 

The iterator function returns an Iterator object which can be used to iterate over the Set.

Examples

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