Package com.dtrules.interpreter

Examples of com.dtrules.interpreter.IRObject.stringValue()


    static class Newdate extends ROperator {
      Newdate(){super("newdate");}

      public void execute(DTState state) throws RulesException {
          IRObject obj   = state.datapop();
          String   date  = obj.stringValue();
        try{
          RTime rdate = RTime.getRDate(state.getSession(), date);
          state.datapush(rdate);
        }catch(RulesException e){
          state.datapush(RNull.getRNull());
View Full Code Here


      throw new RulesException( "Data Stack Underflow", "datapop()", "Data Stack underflow.");
    }
        IRObject rval = datastk[--datastkptr];
        datastk[datastkptr]=null;
        if(testState(VERBOSE)){
            traceInfo("datapop",rval.stringValue());
        }
    return(rval);
  }
 
  /**
 
View Full Code Here

        public void execute(DTState state) throws RulesException {
            IRObject o = state.datapop();
            if(o.type() == iNull){
                state.datapush(o);
            }else{
                state.datapush(RString.newRString(o.stringValue()));
            }
        }
    }
    /**
     * ( Object -- String ) Converts to a Name.  Returns a null if no valid
View Full Code Here

               
                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

        Allocate(){super("allocate"); alias("cpush");}

        public void execute(DTState state) throws RulesException {
            IRObject v = state.datapop();
            if(state.testState(DTState.TRACE)){
                state.traceInfo("allocate", "value",v.stringValue(),null);
            }
            state.cpush(v);
        }
    } 
   
View Full Code Here

        public void execute(DTState state) throws RulesException {
            int      index = state.datapop().intValue();
            IRObject value = state.getFrameValue(index);
            if(state.testState(DTState.TRACE)){
                state.traceInfo("local_fetch", "index",index+"","value",value.stringValue(),null);
            }
            state.datapush(value);
        }
    }
    /**
 
View Full Code Here

        public void execute(DTState state) throws RulesException {
            int      index = state.datapop().intValue();
            IRObject value = state.datapop();
            if(state.testState(DTState.TRACE)){
                state.traceInfo("local_store", "index",index+"","value",value.stringValue(),null);
            }
            state.setFrameValue(index, value);
        }
    }
View Full Code Here

                      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

 
 
   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);
View Full Code Here

         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

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.