Examples of IRObject


Examples of com.dtrules.interpreter.IRObject

     */
    static class While extends ROperator {
        While(){super("while");}

        public void execute(DTState state) throws RulesException {
            IRObject test = state.datapop();         // Get the test
            IRObject body = state.datapop();         // Get the body
           
            test.execute(state);                     // evaluate the test
            while(state.datapop().booleanValue()){   // If true, keep looping
                body.execute(state);                 // execute the body.
                test.execute(state);                 // check the test again.
            }
           
          
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

        public void execute(DTState state) throws RulesException {

            ArrayList array  = state.datapop().arrayValue(); // Get the array
            int       length = array.size();                 // get Array length.
            IRObject body = state.datapop();                 // Get the body
            for(int i=length - 1;i>=0;i--){                  // For each element in array,
                 IRObject o = (IRObject) array.get(i);
                 int      t = o.type();
                 if(t== iNull)continue;
                 if(t!=iEntity){
                    throw new RulesException("Type Check", "Forallr", "Encountered a non-Entity entry in array: "+o);
                
                 state.entitypush((IREntity) o);
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

        Forall(){super("forall");}

        public void execute(DTState state) throws RulesException {
           
            RArray   array = state.datapop().rArrayValue();
            IRObject body = state.datapop();        // Get the body
           
            for(IRObject o : array){
                 int      t = o.type();
                 if(t== iNull)continue;
                 if(t!=iEntity){
                     throw new RulesException("Type Check", "Forallr", "Encountered a non-Entity entry in array: "+o);
                
                 state.entitypush((IREntity) o);
                 body.execute(state);
                 state.entitypop();
            }
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

    static class For extends ROperator {
        For(){super("for");}

        public void execute(DTState state) throws RulesException {
            RArray   list = state.datapop().rArrayValue();
            IRObject body = state.datapop();        // Get the body
            for(IRObject o : list){
                 state.datapush(o);
                 body.execute(state);
            }
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

        Forr(){super("forr");}

        public void execute(DTState state) throws RulesException {
            ArrayList<IRObject> array  = state.datapop().arrayValue(); // Get the array
            int       length = array.size();                 // get Array length.
            IRObject body = state.datapop();                 // Get the body
            for(int i=length-1;i>=0;i++){                    // For each element in array,
                 IRObject o = (IRObject) array.get(i);
                 state.datapush((IRObject) o);
                 body.execute(state);
            }
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

    static class Entityforall extends ROperator {
        Entityforall(){super("entityforall");}

        public void execute(DTState state) throws RulesException {
            IREntity entity  = state.datapop().rEntityValue()// Get the entity
            IRObject body = state.datapop();                    // Get the body
            Iterator keys = entity.getAttributeIterator();      // Get the Attribute Iterator
            while(keys.hasNext()){                         // For each attribute
                RName     n = (RName) keys.next();
                IRObject  v = entity.get(n);
                if(v!=null){
                    state.datapush(n);
                    state.datapush(v);
                    body.execute(state);
                }   
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

       */
    static class Dategt extends ROperator {
      Dategt(){super("d>");}

      public void execute(DTState state) throws RulesException {
        IRObject o2 = state.datapop();
        IRObject o1 = state.datapop();
        Date date1=null, date2=null;
        try{
          date1 = o1.timeValue()
          date2 = o2.timeValue();
        }catch(RulesException e){
          if(date1==null) {
              e.addToMessage("The First Parameter is null");
              try{
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

            Tokenize(){super("tokenize");}

            public void execute(DTState state) throws RulesException {
               
                String   pattern = state.datapop().stringValue();
                IRObject obj1    = state.datapop();
                String   v       = "";
                if(obj1.type() != IRObject.iNull){
                   v = obj1.stringValue().trim();
                }  
                String [] results = v.split(pattern);
               
                RArray r = new RArray(state.getSession().getUniqueID(),false,false);
                for(String t : results){
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

       */
    static class Addto extends ROperator {
      Addto(){super("addto");}

      public void execute(DTState state) throws RulesException {
        IRObject  value = state.datapop();
        RArray rarray  = state.datapop().rArrayValue();
        if(state.testState(DTState.TRACE)){
                    state.traceInfo("addto", "arrayID",rarray.getID()+"",value.postFix());
                }
        rarray.add(value);
      }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

       */
    static class Addat extends ROperator {
      Addat() {super("addat");}
     
      public void execute(DTState state) throws RulesException {
        IRObject value = state.datapop();
        int position = state.datapop().intValue();
                RArray rarray = state.datapop().rArrayValue();
        if(state.testState(DTState.TRACE)){
                    state.traceInfo("addat", "arrayID",rarray.getID()+"", "index",position+"",value.postFix());
                }
        rarray.add(position, value);
       
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.