GeographyMUR_Impl.java

00001 package ;
00002 
00003 
00011   // import configuration classes
00012 
00013 import config.*;
00014 
00015 
00016   // import used generated classes
00017 
00018 import .RodMUR;
00019 import .RodMUR_Helper;
00020 
00021 
00022 class GeographyMUR_Impl implements GeographyMUR {
00023 
00024     // base attributes
00025 
00026   private config.Configuration p_db;
00027   private config.ConfigObject p_obj;
00028   private boolean p_was_read;
00029   private boolean p_is_valid;
00030   private String p_uid;
00031   private String p_class_name;
00032 
00033 
00034     // database class attributes
00035 
00036   private short m_id;
00037   private String m_position;
00038 
00039 
00040     // database class relationships
00041 
00042   private RodMUR m_rodMUR;
00043 
00044 
00045 
00046     // constructor
00047 
00048   public GeographyMUR_Impl() {
00049     p_is_valid = false;
00050   }
00051 
00052   public GeographyMUR_Impl(config.Configuration db, config.ConfigObject obj) {
00053     init_config_params(db, obj);
00054   }
00055 
00056   public void init_config_params(config.Configuration db, config.ConfigObject obj) {
00057     p_db = db;
00058     p_obj = obj;
00059     p_was_read = false;
00060     p_is_valid = true;
00061     p_uid = p_obj.UID();
00062     p_class_name = p_obj.class_name();
00063   }
00064 
00065   public String UID() {
00066     return p_uid;
00067   }
00068 
00069   public String class_name() {
00070     return p_class_name;
00071   }
00072 
00073   public void update(boolean set_non_valid) {
00074     if(set_non_valid == true) {
00075       p_is_valid = false;
00076     }
00077     else {
00078       p_was_read = false;
00079       p_obj.clean();
00080       init();
00081     }
00082   }
00083 
00084   public void unread() {
00085     p_was_read = false;
00086   }
00087 
00088   public boolean is_valid() {
00089     return p_is_valid;
00090   }
00091 
00092 
00093 
00094   private void init() throws config.NotFoundException, config.NotValidException, config.SystemException {
00095     if(p_was_read == true) {return;}
00096 
00097     if(p_is_valid == false) {
00098       String text = "ERROR [.GeographyMUR_Impl.init()]: object " + p_uid + "@" + p_class_name + " is not valid";
00099       System.err.println(text);
00100       throw new config.NotValidException(text);
00101     }
00102 
00103     m_id = p_obj.get_short("id");
00104 
00105     m_position = p_obj.get_string("position");
00106     m_position = (String)p_db.convert((Object)m_position, p_obj, "position");
00107 
00108     m_rodMUR = RodMUR_Helper.get(p_db, p_obj.get_object("rodMUR"));
00109 
00110 
00111     p_was_read = true;
00112 
00113   }
00114 
00115   public short get_id() {
00116     if(p_was_read == false) {init();}
00117     return m_id;
00118   }
00119 
00120   public void set_id(short value) {
00121     p_obj.clean();
00122     p_obj.set_short("id", value);
00123   }
00124 
00125   public String get_position() {
00126     if(p_was_read == false) {init();}
00127     return m_position;
00128   }
00129 
00130   public void set_position(String value) {
00131     p_obj.clean();
00132     p_obj.set_string("position", value);
00133   }
00134 
00135   public RodMUR get_rodMUR() {
00136     if(p_was_read == false) {init();}
00137     return m_rodMUR;
00138   }
00139 
00140   public void set_rodMUR(RodMUR value) {
00141     p_obj.clean();
00142     p_obj.set_object("rodMUR", value.config_object());
00143   }
00144 
00145   public config.ConfigObject config_object() {
00146     return p_obj;
00147   }
00148 
00149   public void print(String dx) {
00150     System.out.println(dx + "GeographyMUR object:" );
00151     System.out.println(dx + "  id: \'" + UID() + "\', class name: \'" + class_name() + "\'");
00152 
00153 
00154       // print attributes
00155 
00156     System.out.println(dx + "  id: " + get_id());
00157     System.out.println(dx + "  position: " + get_position());
00158 
00159 
00160       // print relationships
00161 
00162     System.out.print(dx + "  rodMUR : ");
00163     if(get_rodMUR() == null) {
00164       System.out.println("(null)");
00165     }
00166     else {
00167       System.out.println("\"" + get_rodMUR().UID() + "@" + get_rodMUR().class_name()+ "\"");
00168     }
00169   }
00170 
00176   public void destroy(config.Configuration db) {
00177     db.destroy(config_object());
00178   }
00179 }

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