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

Online Help

All Products    Maple    MapleSim


List.containsAll

test for membership in the List

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

boolean containsAll( Collection<?> o )

Parameters

o

-

Collection of objects

Description

• 

The containsAll function returns true if every member of the collection o is equal to some element of the List and false otherwise.

Examples

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 );

        List s = (List)engine.evaluate( "[2,5,sin(x),1+2*x+x^2,7.5];" );

     java.util.ArrayList arr = new ArrayList<Algebraic>();

     arr.add( engine.newNumeric( 2 ) );

     arr.add( engine.newNumeric( 5 ) );

     arr.add( engine.newNumeric( 7.5 ) );

        System.out.println( "Is the whole collection in the list: " + s.containsAll( arr ) );

    }

}

Executing this code produces the following output:

Is the whole collection in the list: true

See Also

ExternalCalling/Java/MapleException

OpenMaple

OpenMaple/Java/Algebraic

OpenMaple/Java/API

OpenMaple/Java/List

OpenMaple/Java/List/assign

OpenMaple/Java/List/contains

OpenMaple/Java/List/select