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

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


        Float o2 = new Float((float)8.22);
        Integer o3 = new Integer((int)8.22);
        Long o4 = new Long((long)8.22);
        Double o5 = new Double((double)8.22);
        Number[] num={o1,o2,o3,o4,o5};
        ByteConstant n1=new ByteConstant(o1.byteValue());
        FloatConstant n2=new FloatConstant(o2.floatValue());
        IntegerConstant n3=new IntegerConstant(o3.intValue());
        LongConstant n4=new LongConstant(o4.longValue());
        ArrayList passedParams=new ArrayList();
        passedParams.add(n1);
View Full Code Here


    protected static void oneTimeTearDown() throws Exception {

    }

    public void testAllInCollection() {
      propertySensor1 = new ByteConstant((byte)1);
      propertySensor2 = new ByteConstant((byte)2);
      propertySensor3 = new ByteConstant((byte)3);
      propertySensor4 = new ByteConstant((byte)4);
      propertySensor5 = new ByteConstant((byte)5);
      propertySensor6 = new ByteConstant((byte)6);
      propertySensor7 = new ByteConstant((byte)7);
      propertySensor8 = new ByteConstant((byte)8);
     
      StringConstant stringLOR = new StringConstant("\"OR\"");
      StringConstant stringLAND = new StringConstant("\"AND\"");
      StringConstant stringBXOR = new StringConstant("\"XOR\"");
      StringConstant stringNOT_EQUAL = new StringConstant("\"NOT_EQUAL\"");
      StringConstant stringEQUAL = new StringConstant("\"EQUAL\"");
      StringConstant stringLT = new StringConstant("\"LESS\"");
      StringConstant stringGT = new StringConstant("\"GREATER\"");
      StringConstant stringLE = new StringConstant("\"LESS_OR_EQUAL\"");
      StringConstant stringGE = new StringConstant("\"GREATER_OR_EQUAL\"");
     
     
   
   
     
        try {
            Vector v = new Vector();
            Vector vbytes = new Vector();
           
            vbytes.add(propertySensor1);
            vbytes.add(propertySensor2);
            vbytes.add(propertySensor3);
            vbytes.add(propertySensor4);
            vbytes.add(propertySensor5);
            vbytes.add(propertySensor6);
            vbytes.add(propertySensor7);
            vbytes.add(propertySensor8);
           
            Expression collection = new BasicCollectionExpression(vbytes,null);
           
            v.add(new ByteConstant((byte)0));
            v.add(stringGT);
            v.add(collection);
            Expression es1 = new AllInCollection(v,true);
            v.clear();
           
            v.add(new ByteConstant((byte)10));
            v.add(stringLT);
            v.add(collection);
            Expression es2 = new AllInCollection(v,true);
            v.clear();
           
            v.add(new ByteConstant((byte)8));
            v.add(stringLE);
            v.add(collection);
            Expression es3 = new AllInCollection(v,true);
            v.clear();
           
            v.add(new ByteConstant((byte)1));
            v.add(stringGE);
            v.add(collection);
            Expression es4 = new AllInCollection(v,true);
            v.clear();
           
View Full Code Here

            fail("Received expression exception " + e.getMessage());
        }
    }
   
    public void testAnyInCollection() {
      propertySensor1 = new ByteConstant((byte)1);
      propertySensor2 = new ByteConstant((byte)2);
      propertySensor3 = new ByteConstant((byte)3);
      propertySensor4 = new ByteConstant((byte)4);
      propertySensor5 = new ByteConstant((byte)5);
      propertySensor6 = new ByteConstant((byte)6);
      propertySensor7 = new ByteConstant((byte)7);
      propertySensor8 = new ByteConstant((byte)8);
     
      StringConstant stringLOR = new StringConstant("\"OR\"");
      StringConstant stringLAND = new StringConstant("\"AND\"");
      StringConstant stringBXOR = new StringConstant("\"XOR\"");
      StringConstant stringNOT_EQUAL = new StringConstant("\"NOT_EQUAL\"");
      StringConstant stringEQUAL = new StringConstant("\"EQUAL\"");
      StringConstant stringLT = new StringConstant("\"LESS\"");
      StringConstant stringGT = new StringConstant("\"GREATER\"");
      StringConstant stringLE = new StringConstant("\"LESS_OR_EQUAL\"");
      StringConstant stringGE = new StringConstant("\"GREATER_OR_EQUAL\"");
     
   

   
   
     
        try {
            Vector v = new Vector();
            Vector vbytes = new Vector();
           
            vbytes.add(propertySensor1);
            vbytes.add(propertySensor2);
            vbytes.add(propertySensor3);
            vbytes.add(propertySensor4);
            vbytes.add(propertySensor5);
            vbytes.add(propertySensor6);
            vbytes.add(propertySensor7);
            vbytes.add(propertySensor8);
           
            Expression collection = new BasicCollectionExpression(vbytes,null);
           
            v.add(new ByteConstant((byte)6));
            v.add(stringGT);
            v.add(collection);
            Expression es1 = new AnyInCollection(v,true);
            v.clear();
           
            v.add(new ByteConstant((byte)2));
            v.add(stringLT);
            v.add(collection);
            Expression es2 = new AnyInCollection(v,true);
            v.clear();
           
            v.add(new ByteConstant((byte)3));
            v.add(stringLE);
            v.add(collection);
            Expression es3 = new AnyInCollection(v,true);
            v.clear();
           
            v.add(new ByteConstant((byte)4));
            v.add(stringGE);
            v.add(collection);
            Expression es4 = new AnyInCollection(v,true);
            v.clear();
           
View Full Code Here

            fail("Received expression exception " + e.getMessage());
        }
    }
   
    public void testApplyToCollection() {
      propertySensor8 = new ByteConstant((byte)8);
     
      StringConstant stringPLUS = new StringConstant("\"PLUS\"");
      StringConstant stringMINUS = new StringConstant("\"MINUS\"");
      StringConstant stringSTAR = new StringConstant("\"MULTIPLY\"");
      StringConstant stringDIV = new StringConstant("\"DIVIDE\"");
   

   
   
     
        try {
            Vector v = new Vector();
            Vector vbytes = new Vector();
           
            vbytes.add(propertySensor8);
            vbytes.add(propertySensor8);
            vbytes.add(propertySensor8);
            vbytes.add(propertySensor8);
           
           
            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();
           
View Full Code Here

        String s2 = "\""+sn2.toString()+"\"";

        //HashMap map = new HashMap();
        propertySensor1=new StringConstant(s1.toString());
        propertySensor2=new StringConstant(s2.toString());
        propertySensor3=new ByteConstant(sn1.byteValue());
        propertySensor4=new ByteConstant(sn2.byteValue());
        //SensorLookup lookup = new SensorLookupImpl(map);

        try {
            Vector v = new Vector();
            v.add(new StringConstant(s1));
            Expression es1 = new ToSINT8(v,true);

            v.clear();
            v.add(new StringConstant(s2));
            Expression es2 = new ToSINT8(v,true);

            v.clear();
            v.add(new ByteConstant(sn1.byteValue()));
            Expression esn1 = new ToSINT8(v,true);

            v.clear();
            v.add(new ByteConstant(sn2.byteValue()));
            Expression esn2 = new ToSINT8(v,true);

            v.clear();
            v.add(propertySensor1);
            Expression eps1 = new ToSINT8(v,true);
View Full Code Here

TOP

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

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.