Examples of IRObject


Examples of com.dtrules.interpreter.IRObject

   
    if ((attr = (String) attribs.get("set attribute"))!=null){       
      // Look and see if we have an attribute name defined.
       
          RName a = RName.getRName(attr);                
          IRObject value;
                    
                    IREntity enclosingEntity = session.getState().findEntity(a);
                    if(enclosingEntity!=null){
                       
                   
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

    }
        // First add this entity to any list found on the entity stack.
        for(int i=0; i< state.edepth(); i++){
            // Look for all Array Lists on the Entity Stack that look like lists of this Entity
            IREntity entity = state.getes(i);
            IRObject elist = entity.get(listname);
            if(elist!=null && elist.type()==IRObject.iArray){
                // If not a member of this list, then add it.
                if(!((RArray)elist).contains(e)){
                   ((RArray)elist).add(e);
                }
            }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

       */
    static class Req extends ROperator {
      Req(){super("req");}

      public void execute(DTState state) throws RulesException {
        IRObject value2 = state.datapop();
        IRObject value1 = state.datapop();
        state.datapush(RBoolean.getRBoolean(value1.equals(value2)));
      }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

       */
    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

Examples of com.dtrules.interpreter.IRObject

   */
  public IRObject datapop() throws RulesException {
    if(datastkptr<=0) {
      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

Examples of com.dtrules.interpreter.IRObject

    /**
     * Pop the top element from the control stack and return it.
     * @return
     */
    public IRObject cpop(){
        IRObject r = ctrlstk[--ctrlstkptr];
        ctrlstk[ctrlstkptr]= null;
        return r;
    }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

      if(output  == null)output  = "";
     
      boolean  writeable = true;   // We need to convert access to a boolean
      boolean  readable  = true;    // Make an assumption of r/w
      int      itype     = -1;      // We need to convert the type to an int.
      IRObject defaultO  = null;    // We need to convert the default into a Rules Engine Object.
     
      writeable = access.toLowerCase().indexOf("w")>=0;
      readable  = access.toLowerCase().indexOf("r")>=0;
      if(!writeable && !readable){
          errorMsgs +="\nThe attribute "+attribute+" has to be either readable or writable\r\n";
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

        } catch (RulesException e1) {
          errorMsgs+= e1.getMessage()+"\n";
          succeeded = false;
        }
               
        IRObject defaultO = EntityFactory.computeDefaultValue(session, ef, default_value, itype) ;
       
        RName  entityRName = RName.getRName(entityname.trim(),false);
        RName  attributeRName = RName.getRName(attrib_name.trim(),false);
        REntity entity = ef.findcreateRefEntity(false,entityRName);
        int    intType = -1;
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

     */
    static class  Def extends ROperator {
        Def(){super("def");}

        public void execute(DTState state) throws RulesException {
            IRObject value = state.datapop();
            RName    name  = state.datapop().rNameValue();
            boolean f = state.def(name, value, true);
            if(!f)throw new RulesException("Undefined",
                    "def",
                    name+" is undefined");
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

    static class  Find   extends ROperator {
        Find(){super("find");}

        public void execute(DTState state) throws RulesException {
            RName    name = state.datapop().rNameValue();
            IRObject v    = state.find(name);
            if(v==null)throw new RulesException("Undefined",
                    "find",
                    name+" is undefined");
        }
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.