RodMUR_Helper.java

00001 package ;
00002 
00003 
00011   // import configuration classes
00012 
00013 import config.*;
00014 
00015 
00029 public class RodMUR_Helper {
00030 
00038   static public RodMUR get(config.Configuration db, config.ConfigObject obj) {
00039     if(obj == null) { return null; }
00040     RodMUR_Impl o = (RodMUR_Impl)db.get("RodMUR", obj);
00041     if(o == null) {
00042       o = new RodMUR_Impl(db, obj);
00043       db.add("RodMUR", obj.UID(), o);
00044     }
00045     return o;
00046   }
00047 
00048 
00056   static public RodMUR get(config.Configuration db, String id) {
00057       // check the object is already in cache
00058     RodMUR o = (RodMUR)db.get("RodMUR", id);
00059     if(o != null) return o;
00060 
00061       // check the object exists and get it from database
00062     config.ConfigObject obj = db.get_object("RodMUR", id);
00063     return get(db, obj);
00064   }
00065 
00066 
00075   static public RodMUR[] get(config.Configuration db, config.Query query) {
00076     ConfigObject[] objs = db.get_objects("RodMUR", query);
00077     RodMUR[] result = new RodMUR[objs.length];
00078     for (int i = 0; i < objs.length; i++) {
00079       result[i] = get(db, objs[i]);
00080     }
00081     return result;
00082   }
00083 
00091   static public RodMUR create(config.Configuration db, String file, String id) {
00092     return get(db, db.create(file, "RodMUR", id));
00093   }
00094 
00102   static public RodMUR create(config.Configuration db, config.DalObject at, String id) {
00103     return get(db, db.create(at.config_object(), "RodMUR", id));
00104   }
00105 
00106 }

Generated on Mon Feb 6 14:12:17 2006 for SCT DAQ/DCS Software - Java by  doxygen 1.4.6