Package com.dtrules.interpreter

Examples of com.dtrules.interpreter.RTable


      */
     public static class SetDescription extends ROperator {
         SetDescription() { super("setdescription"); }
         public void arrayExecute(DTState state) throws RulesException {
             RString description  = state.datapop().rStringValue();
             RTable  table        = state.datapop().rTableValue();
             table.setDescription(description);
         }
View Full Code Here


     public static class Translate extends ROperator {
         Translate(){super("translate"); }
         public void arrayExecute(DTState state) throws RulesException {
             boolean duplicates = state.datapop().booleanValue();
             RArray  keys       = state.datapop().rArrayValue();
             RTable  table      = state.datapop().rTableValue();
             RArray valueArray = new RArray(state.getSession().getUniqueID(),duplicates,false);
             for(IRObject key : keys){
                 if(table.containsKey(key)){
                    valueArray.add(table.getValue(key));
                 }
             }
             state.datapush(valueArray);
         }
View Full Code Here

                } catch (ParseException e) {
                    throw new RulesException("Invalid Date Format","EntityFactory.computeDefaultValue","Only support dates in 'MM/dd/yyyy' form.");
                }
        }
        if(itype == IRObject.iTable ) {
                RTable table = RTable.newRTable(ef, null, defaultstr);
                if(defaultstr.length()==0) return table;
                table.setValues(session, defaultstr);
                return table;
        }
       
        return RNull.getRNull();
       
View Full Code Here

        node.setMap(new HashMap<Object,Object>());
      }else{
          node.getMap().clear();
      }
     
        RTable result = (RTable) node.getTargetMap();
        Set<IRObject> keys = result.getTable().keySet();
        for(IRObject key : keys){
            Object thekey   = convert(key);
            Object thevalue = null;
            try {
                thevalue = convert(result.getValue(key));
            } catch (RulesException e) {}
            node.getMap().put(thekey, thevalue);
        }
    }
View Full Code Here

        }
    }
   
    @Override
    public Object mapMap(AutoDataMap autoDataMap, LabelMap labelMap, MapNodeMap node){
        RTable rTable = null;
        try {
            RName rname = null;
            Object object = autoDataMap.getCurrentObject();
            if(object instanceof IREntity){
                IREntity entity = (IREntity) object;
                rname = mapName(autoDataMap, labelMap, node.getAttribute().getName() );
                IRObject olist = entity.get(rname);
                if(olist != null && olist.type().getId() == IRObject.iTable){
                    rTable = olist.rTableValue();
                }
            }
            if(rTable == null){
                rTable = RTable.newRTable(autoDataMap.getSession().getEntityFactory(),
                        null , null);
            }
           
            node.setTargetMap(rTable);
            if(node.getMap() != null){
              Set<Object> keys = node.getMap().keySet();
              for(Object key : keys ){
                  rTable.setValue(iconvert(key),
                          iconvert(node.getMap().get(key).toString()));
              }
            }
        } catch (RulesException e) { }
       
View Full Code Here

                    throw new RulesException("Invalid Date Format","EntityFactory.computeDefaultValue","Only support dates in 'MM/dd/yyyy' form.");
                }
            }
            case IRObject.iTable : {
                if(defaultstr.length()==0) return RNull.getRNull();
                RTable table = RTable.newRTable(ef, null, defaultstr, -1);
                table.setValues(session, defaultstr);
                return table;
            }
            default: return RNull.getRNull();
      }
    }
View Full Code Here

                } catch (ParseException e) {
                    throw new RulesException("Invalid Date Format","EntityFactory.computeDefaultValue","Only support dates in 'MM/dd/yyyy' form.");
                }
        }
        if(itype == IRObject.iTable ) {
                RTable table = RTable.newRTable(ef, null, defaultstr);
                if(defaultstr.length()==0) return table;
                table.setValues(session, defaultstr);
                return table;
        }
       
        return RNull.getRNull();
       
View Full Code Here

             while(state.getds(--d).type().getId()!=iTable)cnt++;
             RName []keys = new RName[cnt];
             for(int i=0;i<cnt;i++){
                keys[i]= state.datapop().rNameValue();
             }
             RTable rtable = state.datapop().rTableValue();
             state.datapush(rtable.getValue(keys));
         }
View Full Code Here

     public static class GetWithKey extends ROperator {
         GetWithKey(){ super("getwithkey");}
        
         public void execute(DTState state) throws RulesException {
             IRObject key = state.datapop();
             RTable rtable = state.datapop().rTableValue();
             state.datapush(rtable.getValue(key));
         }
View Full Code Here

     
         public void execute(DTState state) throws RulesException {
            
             IRObject   v      = state.datapop();                // Get the value to store
             IRObject   key    = state.datapop().rNameValue();
             RTable     rtable = state.datapop().rTableValue();
             rtable.setValue(key,v);
            
         }
View Full Code Here

TOP

Related Classes of com.dtrules.interpreter.RTable

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.