Examples of IRObject


Examples of com.dtrules.interpreter.IRObject

     */
    static class FMul extends ROperator {
        FMul(){super("f*");alias("fmul");}

        public void execute(DTState state) throws RulesException {
            IRObject d2 = state.datapop();
            IRObject d1 = state.datapop();
            state.datapush(RDouble.getRDoubleValue(d1.doubleValue()*d2.doubleValue()));
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

    private void dump(REntity e,int depth){
        Iterator<RName> anames = e.getAttributeIterator();
        while(anames.hasNext()){
            try {
                RName        aname = anames.next();
                IRObject     value = e.get(aname);
               
                dtstate.traceTagBegin("attribute", "name",aname.stringValue(),"type",getType(e,aname));
                switch(e.getEntry(aname).type){
                   case IRObject.iEntity: {
                      if(value.type()==IRObject.iNull){
                          dtstate.traceInfo("value","type","null","value","null",null);
                          break;
                      }
                      dtstate.traceTagBegin("entity",
                              "name",   ((REntity)value).getName().stringValue(),
                              "id",     printIds ? ((REntity)value).getID()+"" : "");
                     
                      if(!(boundries.get(e)!= null && boundries.get(e).contains(value))){
                          dtstate.debug(" recurse\n");
                      }else{
                          if(boundries.get(e)==null)boundries.put(e, new ArrayList());
                          boundries.get(e).add(value);
                          dump((REntity)value, depth+1);
                      }
                      dtstate.traceTagEnd();
                      break;
                   }  
                   case IRObject.iArray: {
                      ArrayList values = value.arrayValue();
                      Iterator iv = values.iterator();
                      while(iv.hasNext()){
                          IRObject v = (IRObject) iv.next();
                          if(v.type()==IRObject.iEntity){
                              dump((REntity)v,depth+2);
                          }else{
                              dtstate.traceInfo("value","v",v.stringValue(),null);
                          }
                      }
                      break;
                   }
                   default : {
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

   */
 
 
   public void printEntity(IXMLPrinter rpt, String tag, IREntity e) throws Exception {
       if(tag==null)tag = e.getName().stringValue();
       IRObject id = e.get(RName.getRName("mapping*key"));
       String   idString = id!=null?id.stringValue():"--none--";
         rpt.opentag(tag,"DTRulesId",e.getID()+"","id",printIds ? idString : "");
         Set<RName> names = e.getAttributeSet();
         RName keys[] = sort(names);
         for(RName name : keys){
             IRObject v    = e.get(name);
             if(v.type()==IRObject.iArray && v.rArrayValue().size()==0) continue;
             String   vstr = v==null?"":v.stringValue();
             rpt.printdata("attribute","name",name.stringValue(), vstr);
         }
   }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

     */
    static class Swap extends ROperator {
        Swap(){super("swap"); alias("exch");}

        public void execute(DTState state) throws RulesException {
            IRObject obj1  = state.datapop();
            IRObject obj2  = state.datapop();
            state.datapush(obj1);
            state.datapush(obj2);
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

     */
    static class Dup extends ROperator {
        Dup(){super("dup");}

        public void execute(DTState state) throws RulesException {
            IRObject obj1  = state.datapop();
            state.datapush(obj1);
            state.datapush(obj1);
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

             RTable table)throws RulesException{
        
         Set<IRObject> keys = table.getTable().keySet();
           rpt.opentag("map", "id", printIds ? table.getId(): "");
               for(IRObject key : keys){
                  IRObject value = table.getValue(key);
                  rpt.opentag("pair");
                      rpt.opentag("key");
                          printIRObject(rpt,entitypath,printed,state,"",key);
                      rpt.closetag();
                      rpt.opentag("value");
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

         printEntityReport(rpt,false, false,state,objname);
     }
     public void printEntityReport(IXMLPrinter rpt, boolean printIds, boolean verbose, DTState state, String name ) {
         this.printIds = printIds;
       IRObject obj = state.find(name);
         printEntityReport(rpt,printIds, verbose,state,name,obj);
     }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

         }else if (printed!= null && printed.contains(e)){
                 rpt.printdata(entityName,"DTRulesId",printIds ? e.getID():"","id",e.get("mapping*key").stringValue(),"multiple reference")
         }else{
             entitypath.add(e);
             if(printed!=null) printed.add(e);
             IRObject id = e.get(RName.getRName("mapping*key"));
             String   idString = id!=null?id.stringValue():"--none--";
             rpt.opentag(entityName,"DTRulesId",printIds ? e.getID():"","id",idString);
             Set<RName> keys = e.getAttributeSet();
             RName akeys [] = sort(keys);
             for(RName name : akeys){
                 IRObject v    = e.get(name);
                 printIRObject(rpt, entitypath, printed, state, name.stringValue(), v);
             }
             rpt.closetag();
             entitypath.remove(entitypath.size()-1);
         }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

     */
    static class Over    extends ROperator {
        Over(){super("over");}

        public void execute(DTState state) throws RulesException {
            IRObject obj1 = state.getds(state.ddepth()-2);
            state.datapush(obj1);
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

     */
    static class Entitypush    extends ROperator {
        Entitypush(){super("entitypush");}

        public void execute(DTState state) throws RulesException {
            IRObject o = state.datapop();
            IREntity e;
            try{
               e = o.rEntityValue();
            }catch(RulesException ex){
               ex.addToMessage("entitypush could not convert a "+RSession.typeInt2Str(o.type())+" to an Entity");
               throw ex;
            }
            state.entitypush(e);           
            if(state.testState(DTState.TRACE)){
               state.traceInfo("entitypush", "value",e.stringValue(),"id",e.getID()+"",null);
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.