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

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


    int n = 3;

    //HashMap map = new HashMap();
    propertySensor1=new StringConstant(s1);
    propertySensor2=new StringConstant(s2);
    propertySensor3=new IntegerConstant(1);
    //SensorLookup lookup = new SensorLookupImpl(map);

    try {
      Vector v = new Vector();
      v.add(new StringConstant(s1));
      v.add(new StringConstant(s2));
      v.add(new IntegerConstant(n));
      Expression e1 = new Word(v,true);

      v.clear();
      v.add(propertySensor1);
      v.add(propertySensor2);
View Full Code Here


              fail("Received expression exception " + e.getMessage());
          }
      }
    
     public void testToString() {
        propertySensor1=new IntegerConstant(845);
          propertySensor2=new BooleanConstant(true);
         
          try {
              Vector v = new Vector();
              v.add(propertySensor1);
View Full Code Here

    try {
      Expression exp;

      Vector v = new Vector();
      v.add(new StringConstant(s1));
      v.add(new IntegerConstant(8));
      exp = new Substring(v,true);
      assertTrue(exp.evaluate().equals("DigitsAndLetters12345"));

      v.clear();
      v.add(propertySensor1);
      v.add(new IntegerConstant(8));
      exp = new Substring(v,true);
      assertTrue(exp.evaluate().equals("DigitsAndLetters12345"));

      v.clear();
      v.add(new StringConstant(s1));
      v.add(new IntegerConstant(8));
      v.add(new IntegerConstant(24));
      exp = new Substring(v,true);
      assertTrue(exp.evaluate().equals("DigitsAndLetters"));

      v.clear();
      v.add(propertySensor1);
      v.add(new IntegerConstant(8));
      v.add(new IntegerConstant(24));
      exp = new Substring(v,true);
      assertTrue(exp.evaluate().equals("DigitsAndLetters"));
    } catch (SPLException e) {
      e.printStackTrace();
      fail("Received evaluation exception " + e.getMessage());
View Full Code Here

 
  public void testIntegerConstant() {
    Integer s1 = new Integer(1);
   
    //HashMap map = new HashMap();
    propertySensor1=new IntegerConstant(s1.intValue());
   
   
    //SensorLookup lookup = new SensorLookupImpl(map);

    try {
View Full Code Here

  }
 
  public void testBasicCollectionExpression() {
    int c1=10;
    //HashMap map = new HashMap();
    propertySensor1=new IntegerConstant(c1);
    propertySensor2=new IntegerConstant(c1);
    propertySensor3=new IntegerConstant(c1);
    propertySensor4=new IntegerConstant(c1);
    propertySensor5=new IntegerConstant(c1);
   
   
   
    //SensorLookup lookup = new SensorLookupImpl(map);
View Full Code Here

    case TypeConstants.floatType:
      returnExpr = new FloatConstant(Float.valueOf(val).floatValue());
      break;

    case TypeConstants.intType:
      returnExpr = new IntegerConstant(Integer.valueOf(val).intValue());
      break;
    case TypeConstants.shortType:
      returnExpr = new ShortConstant(Short.valueOf(val).shortValue());
      break;
View Full Code Here

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

        //HashMap map = new HashMap();
        propertySensor1=new StringConstant(s1.toString());
        propertySensor2=new StringConstant(s2.toString());
        propertySensor3=new IntegerConstant(in1.intValue());
        propertySensor4=new IntegerConstant(in2.intValue());
        //SensorLookup lookup = new SensorLookupImpl(map);

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

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

            v.clear();
            v.add(new IntegerConstant(in1.intValue()));
            Expression ein1 = new ToSINT32(v,true);

            v.clear();
            v.add(new IntegerConstant(in2.intValue()));
            Expression ein2 = new ToSINT32(v,true);

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

        double dn1 = 2.3, dn2 = -100.4, dn3 = 3.1415926;

        //HashMap map = new HashMap();
    propertySensor1=new ShortConstant(sn1);
    propertySensor2=new ShortConstant(sn2);
    propertySensor3=new IntegerConstant(in1);
    propertySensor4=new IntegerConstant(in2);
    propertySensor5=new LongConstant(ln1);
    propertySensor6=new LongConstant(ln2);
    propertySensor7=new FloatConstant(fn1);
    propertySensor8=new FloatConstant(fn2);
    propertySensor9=new DoubleConstant(dn1);
    propertySensor10=new DoubleConstant(dn2);


        //SensorLookup lookup = new SensorLookupImpl(map);

        try {
            Vector v = new Vector();
            v.add(new ShortConstant(sn1));
            v.add(new ShortConstant(sn2));
           
            Expression es = new Addition(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            v.add(new IntegerConstant(in2));
           
            Expression ei = new Addition(v,true);

            v.clear();
            v.add(new LongConstant(ln1));
            v.add(new LongConstant(ln2));
          
            Expression el = new Addition(v,true);

            v.clear();
            v.add(new FloatConstant(fn1));
            v.add(new FloatConstant(fn2));
           
            Expression ef = new Addition(v,true);

            v.clear();
            v.add(new DoubleConstant(dn1));
            v.add(new DoubleConstant(dn2));
          
            Expression ed = new Addition(v,true);

            v.clear();
            v.add(new ShortConstant(sn1));
            v.add(new IntegerConstant(in1));
           
            Expression emix1 = new Addition(v,true);
           
            v.clear();
            v.add(new LongConstant(ln1));
            v.add(new FloatConstant(fn1));
            Expression emix2 = new Addition(v,true);

            v.clear();
            v.add(new FloatConstant(fn1));
            v.add(new DoubleConstant(dn1));
            Expression emix3 = new Addition(v,true);


            v.clear();
          
            v.add(propertySensor2);
            v.add(new ShortConstant(sn3));
            Expression eps1 = new Addition(v,true);

            v.clear();
            v.add(propertySensor4);
            v.add(new IntegerConstant(in3));
            Expression eps2 = new Addition(v,true);

            v.clear();
           
            v.add(propertySensor6);
View Full Code Here

        double dn1 = 2.3, dn2 = -3.1415926;

        //HashMap map = new HashMap();
    propertySensor1=new ShortConstant(sn1);
    propertySensor2=new ShortConstant(sn2);
    propertySensor3=new IntegerConstant(in1);
    propertySensor4=new IntegerConstant(in2);
    propertySensor5=new LongConstant(ln1);
    propertySensor6=new LongConstant(ln2);
    propertySensor7=new FloatConstant(fn1);
    propertySensor8=new FloatConstant(fn2);
    propertySensor9=new DoubleConstant(dn1);
    propertySensor10=new DoubleConstant(dn2);

        //SensorLookup lookup = new SensorLookupImpl(map);

        try {
            Vector v = new Vector();
            v.add(new ShortConstant(sn1));
            v.add(new ShortConstant(sn2));
            Expression es = new Subtraction(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            v.add(new IntegerConstant(in2));
            Expression ei = new Subtraction(v,true);

            v.clear();
            v.add(new LongConstant(ln1));
            v.add(new LongConstant(ln2));
            Expression el = new Subtraction(v,true);

            v.clear();
            v.add(new FloatConstant(fn1));
            v.add(new FloatConstant(fn2));
            Expression ef = new Subtraction(v,true);

            v.clear();
            v.add(new DoubleConstant(dn1));
            v.add(new DoubleConstant(dn2));
            Expression ed = new Subtraction(v,true);

            v.clear();
            v.add(new ShortConstant(sn1));
            v.add(new IntegerConstant(in1));
            Expression emix1 = new Subtraction(v,true);

            v.clear();
            v.add(new ShortConstant(sn1));
            v.add(new LongConstant(ln1));
            Expression emix2 = new Subtraction(v,true);

            v.clear();
            v.add(new ShortConstant(sn1));
            v.add(new FloatConstant(fn1));
            Expression emix3 = new Subtraction(v,true);

            v.clear();
            v.add(new ShortConstant(sn1));
            v.add(new DoubleConstant(dn1));
            Expression emix4 = new Subtraction(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            v.add(new LongConstant(ln1));
            Expression emix5 = new Subtraction(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            v.add(new FloatConstant(fn1));
            Expression emix6 = new Subtraction(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            v.add(new DoubleConstant(dn1));
            Expression emix7 = new Subtraction(v,true);

            v.clear();
            v.add(new LongConstant(ln1));
View Full Code Here

        double dn1 = 2.3, dn2 = -100.4, dn3 = 3.1415926;

        //HashMap map = new HashMap();
    propertySensor1=new ShortConstant(sn1);
    propertySensor2=new ShortConstant(sn2);
    propertySensor3=new IntegerConstant(in1);
    propertySensor4=new IntegerConstant(in2);
    propertySensor5=new LongConstant(ln1);
    propertySensor6=new LongConstant(ln2);
    propertySensor7=new FloatConstant(fn1);
    propertySensor8=new FloatConstant(fn2);
    propertySensor9=new DoubleConstant(dn1);
    propertySensor10=new DoubleConstant(dn2);

   
        //SensorLookup lookup = new SensorLookupImpl(map);

        try {
            Vector v = new Vector();
           
            v.add(new ShortConstant(sn2));
            v.add(new ShortConstant(sn3));
            Expression es = new Product(v,true);

            v.clear();
          
            v.add(new IntegerConstant(in2));
            v.add(new IntegerConstant(in3));
            Expression ei = new Product(v,true);

            v.clear();
          
            v.add(new LongConstant(ln2));
            v.add(new LongConstant(ln3));
            Expression el = new Product(v,true);

            v.clear();
           
            v.add(new FloatConstant(fn2));
            v.add(new FloatConstant(fn3));
            Expression ef = new Product(v,true);

            v.clear();
           
            v.add(new DoubleConstant(dn2));
            v.add(new DoubleConstant(dn3));
            Expression ed = new Product(v,true);

            v.clear();
            v.add(new ShortConstant(sn1));
            v.add(new IntegerConstant(in1));
           
            Expression emix1 = new Product(v,true);
           
            v.clear();
           
View Full Code Here

TOP

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

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.