Examples of RName


Examples of com.dtrules.interpreter.RName

        }
        PrintStream  ps  = new PrintStream(out);
        Iterator<RName> entities = ef.getEntityRNameIterator();
        ps.println("<entity_data_dictionary>");
        while(entities.hasNext()){
            RName ename = entities.next();
            ef.findRefEntity(ename).writeXML(ps);
        }
        ps.println("\n</entity_data_dictionary>");
  }
View Full Code Here

Examples of com.dtrules.interpreter.RName

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

Examples of com.dtrules.interpreter.RName

     * @param name The name of the Entity to create
     * @return     The entity created.
     * @throws RulesException Thrown if any problem occurs (such as an undefined Entity name)
   */
  public IREntity createEntity(Object id, String name) throws RulesException{
        RName entity = RName.getRName(name);
    return createEntity(id, entity);
  }
View Full Code Here

Examples of com.dtrules.interpreter.RName

       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.RName

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

Examples of com.dtrules.interpreter.RName

             entitypath.remove(entitypath.size()-1);
         }
     }
   
     public RName [] sort(Set<RName> keys) {
       RName  ret[] = keys.toArray(new RName[0]);
       int cnt = ret.length;
       for(int i = 0; i< cnt-1; i++){
         for(int j = 0; j < cnt-1-i; j++){
           RName one = ret[j];
           RName two = ret[j+1];
           if(one.stringValue().compareTo(two.stringValue())>0){
             RName hld = ret[j];
             ret[j]    = ret[j+1];
             ret[j+1= hld;
           }
         }
       }
View Full Code Here

Examples of com.dtrules.interpreter.RName

   * @throws RulesException
   */
    public void printBalancedTables(PrintStream out)throws RulesException {
        Iterator<RName> dts = this.getEntityFactory().getDecisionTableRNameIterator();
        while(dts.hasNext()){
            RName dtname = dts.next();
            RDecisionTable dt = this.getEntityFactory().findDecisionTable(dtname);
            String t;
            try{
              t = dt.getBalancedTable().getPrintableTable();
            }catch(RulesException e){
              System.out.flush();
              System.err.println("The Decision Table '"+dt.getName().stringValue()
                  +"' is too complex, and must be split into two tables.");
              t = "Table too Big to Print";
              System.err.flush();
            }
            out.println();
            out.println(dtname.stringValue());
            out.println();
            out.println(t);
        }
    }
View Full Code Here

Examples of com.dtrules.interpreter.RName

     *
     */
    static class Get    extends ROperator {
        Get(){super("get");}
        public void execute(DTState state) throws RulesException {
          RName    n = state.datapop().rNameValue();
            IREntity e = state.datapop().rEntityValue();
            IRObject v = e.get(n);
            state.datapush(v);
        }
View Full Code Here

Examples of com.dtrules.interpreter.RName

  public String toString(){
    String v = name.stringValue()+" = {";
        Iterator<RName> ia = getAttributeIterator();
        while(ia.hasNext()){
            RName    n = ia.next();
            IRObject o = get(n);
            if(o==null){                // Protect ourselves from nulls.
                o = RNull.getRNull();
            }
            v +=n.stringValue()+" = "+get(n).stringValue()+"  ";
        }
        v +="}";
        return v;
       
  }
View Full Code Here

Examples of com.dtrules.interpreter.RName

   
    public void writeXML(PrintStream p) throws RulesException {
        Iterator<RName> attribs = getAttributeIterator();
        p.println();
        while(attribs.hasNext()){
           RName attrib = attribs.next();
           if(attrib.equals(name))continue;     // Skip the self reference.
           REntityEntry entry = attributes.get(attrib);
           p.print("<entity attribute=\"");
           p.print(attrib.stringValue());
           p.print("\" type =\"");
           p.print(RSession.typeInt2Str(entry.type));
           p.print("\" cdd_default_value=\"");
           p.print(entry.defaulttxt);
           p.print("\" cdd_i_c=\"");
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.