Package org.apache.imperius.spl.parser.expressions.impl

Examples of org.apache.imperius.spl.parser.expressions.impl.ApplyToCollection


            Expression collection = new BasicCollectionExpression(vbytes,null);
           
            v.add(new ByteConstant((byte)10));
            v.add(stringPLUS);
            v.add(collection);
            Expression es1 = new ApplyToCollection(v,true);
            v.clear();
           
            v.add(new ByteConstant((byte)4));
            v.add(stringMINUS);
            v.add(collection);
            Expression es2 = new ApplyToCollection(v,true);
            v.clear();
           
            v.add(new ByteConstant((byte)2));
            v.add(stringSTAR);
            v.add(collection);
            Expression es3 = new ApplyToCollection(v,true);
            v.clear();
           
            v.add(new ByteConstant((byte)2));
            v.add(stringDIV);
            v.add(collection);
            Expression es4 = new ApplyToCollection(v,true);
            v.clear();
           
            List resultarr1=(List)es1.evaluate();
            for(int i=0;i<resultarr1.size();i++){
              //System.out.println(((Number)resultarr1.get(i)).intValue());
              assertTrue(((Number)resultarr1.get(i)).intValue()==18);

            }
           
            List resultarr2=(List)es2.evaluate();
            for(int i=0;i<resultarr2.size();i++){
              //System.out.println(((Number)resultarr2.get(i)).intValue());
              assertTrue(((Number)resultarr2.get(i)).intValue()==4);

            }
           
            List resultarr3=(List)es3.evaluate();
            for(int i=0;i<resultarr3.size();i++){
              //System.out.println(((Number)resultarr3.get(i)).intValue());
              assertTrue(((Number)resultarr3.get(i)).intValue()==16);

            }
           
            List resultarr4=(List)es4.evaluate();
            for(int i=0;i<resultarr4.size();i++){
              //System.out.println(((Number)resultarr4.get(i)).intValue());
              assertTrue(((Number)resultarr4.get(i)).intValue()==4);

            }
View Full Code Here

TOP

Related Classes of org.apache.imperius.spl.parser.expressions.impl.ApplyToCollection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.