Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

GeneratorWrapper Class Reference

Collaboration diagram for GeneratorWrapper:

Collaboration graph
[legend]
List of all members.

Detailed Description

Wrapper for the generator class. The DBObjectManager expects the object it is to write to contain methods such as getx, gety. The Generator does not have all the methods with the correct names and contains some get** methods that we don't want to write, so we wrap it here.

Definition at line 16 of file GeneratorWrapper.java.


Public Member Functions

 GeneratorWrapper (Generator xx)
GeneratorWrapper update ()
Vector< Integer > getparameterId ()
Vector< String > getname ()
Vector< Integer > getivalue ()
Vector< Double > getrvalue ()
Vector< Integer > getaindices ()
String toString ()
Vector< Boolean > getrelPhoton ()
Vector< Boolean > getrelProton ()
Generator generator ()

Private Attributes

Generator gen = null
Vector< Integer > ids = new Vector<Integer>()
Vector< String > names = new Vector<String>()
Vector< Integer > ivalues = new Vector<Integer>()
Vector< Double > rvalues = new Vector<Double>()
Vector< Integer > aindices = new Vector<Integer>()
Vector< Boolean > relPhoton_ = new Vector<Boolean>()
Vector< Boolean > relProton_ = new Vector<Boolean>()

Constructor & Destructor Documentation

GeneratorWrapper Generator  xx  ) 
 

Instantiates a new GeneratorWrapper from a generator

Parameters:
Generator the generator to be wrapped

Definition at line 35 of file GeneratorWrapper.java.

00035                                          {
00036     gen = xx;
00037     update();
00038     
00039     return;
00040     }


Member Function Documentation

Generator generator  ) 
 

Returns:
generator the generator which was wrapped.

Definition at line 248 of file GeneratorWrapper.java.

Referenced by FileUploader.doDefaultsXMLUpload().

00248                                 {
00249     return gen;
00250     }

Vector<Integer> getaindices  ) 
 

Returns:
Vector<Integer> the array indices

Definition at line 207 of file GeneratorWrapper.java.

00207                                         {
00208     return(aindices);
00209     }

Vector<Integer> getivalue  ) 
 

Returns:
Vector<Integer> the integer parameters

Definition at line 187 of file GeneratorWrapper.java.

00187                                       {
00188     //Vector<Integer> ivalues = new Vector<Integer>();
00189 
00190     return(ivalues);
00191     }

Vector<String> getname  ) 
 

Returns:
Vector<String> of the parameter names

Definition at line 178 of file GeneratorWrapper.java.

00178                                    {
00179     //Vector<String> names = new Vector<String>();
00180     return(names);
00181     }

Vector<Integer> getparameterId  ) 
 

Returns:
Vector<Integer> of the parameter ids

Definition at line 168 of file GeneratorWrapper.java.

00168                                            {
00169     //Vector<Integer> ids = new Vector<Integer>();
00170        
00171     return(ids);
00172     }

Vector<Boolean> getrelPhoton  ) 
 

Definition at line 236 of file GeneratorWrapper.java.

00236                                          {
00237     return relPhoton_;
00238     }

Vector<Boolean> getrelProton  ) 
 

Definition at line 240 of file GeneratorWrapper.java.

00240                                          {
00241     return(relProton_);
00242     }

Vector<Double> getrvalue  ) 
 

Returns:
Vector<Double> the real parameters

Definition at line 197 of file GeneratorWrapper.java.

00197                                      {
00198     //Vector<Double> rvalues = new Vector<Double>();
00199 
00200     return(rvalues);
00201     }

String toString  ) 
 

Returns:
String the generator name and version

Definition at line 215 of file GeneratorWrapper.java.

Referenced by FileUploader.doDefaultsXMLUpload(), and GenDefaults.main().

00215                             {
00216 
00217     //get rid of all the .s in the name
00218 
00219     String  name = gen.toString();
00220     int ii = name.indexOf(".");
00221     
00222     while(ii>-1){
00223         name = name.substring(0,ii)+name.substring(ii+1);
00224         ii = name.indexOf(".");
00225     }
00226 
00227     ii = name.indexOf("-");
00228 
00229     return(name.substring(0,ii)+name.substring(ii+1));
00230     }

GeneratorWrapper update  ) 
 

Updates the wrapper to contain the current set of parameters held by the generator

Definition at line 47 of file GeneratorWrapper.java.

00047                                     {
00048 
00049     HashMap<String, Integer> intParameters = gen.getIntParameters();
00050     HashMap<String, Double> realParameters = gen.getRealParameters();
00051     HashMap<String, HashMap<Integer, Integer>> intParameterArrays = 
00052         gen.getIntParameterArrays();
00053     HashMap<String, HashMap<Integer, Double>> realParameterArrays = 
00054         gen.getRealParameterArrays();
00055 
00056     ids = new Vector<Integer>();
00057     names = new Vector<String>();
00058     rvalues = new Vector<Double>();
00059     ivalues = new Vector<Integer>();
00060     aindices = new Vector<Integer>();
00061     relPhoton_ = new Vector<Boolean>();
00062     relProton_ = new Vector<Boolean>();
00063 
00064     Iterator it = intParameters.entrySet().iterator();
00065     Integer id=0;
00066     Short aindex = 0;
00067     while(it.hasNext()){
00068         ++id;
00069         Entry ent = (Entry)it.next();
00070         String name = (String)ent.getKey();
00071         names.add(name);
00072         ivalues.add((Integer)ent.getValue());
00073         try{
00074         relPhoton_.add(gen.getIsRelevantToPhoton(name));
00075         relProton_.add(gen.getIsRelevantToProton(name));
00076         }catch(Throwable err){
00077         System.out.println(err.getMessage());
00078         }
00079         rvalues.add(null);
00080         aindices.add(null);
00081         ids.add(id);
00082     }
00083 
00084     it = realParameters.entrySet().iterator();
00085     while(it.hasNext()){
00086         ++id;
00087         Entry ent = (Entry)it.next();
00088         String name = (String)ent.getKey();
00089         names.add(name);
00090         rvalues.add((Double)ent.getValue());
00091         try{
00092         relPhoton_.add(gen.getIsRelevantToPhoton(name));
00093         relProton_.add(gen.getIsRelevantToProton(name));
00094         }catch(Throwable err){
00095         System.out.println(err.getMessage());
00096         }
00097         ivalues.add(null);
00098         aindices.add(null);
00099         ids.add(id);
00100     }
00101 
00102     it = intParameterArrays.entrySet().iterator();
00103 
00104     while(it.hasNext()){
00105         Entry ient = (Entry)it.next();
00106         String name = (String)ient.getKey();
00107         HashMap<Integer, Integer> jmap = 
00108         (HashMap<Integer, Integer>)ient.getValue();
00109         Iterator jt = jmap.entrySet().iterator();
00110         //      aindex = 0;
00111         while(jt.hasNext()){
00112         ++id;
00113         Entry jent = (Entry)jt.next();
00114         names.add(name);
00115         ivalues.add((Integer)jent.getValue());
00116         rvalues.add(null);
00117         Integer index = (Integer)jent.getKey();
00118         aindices.add(index);
00119         ids.add(id);
00120         try{
00121             relPhoton_.add(gen.getIsRelevantToPhoton(name, index));
00122             relProton_.add(gen.getIsRelevantToProton(name, index));
00123         }catch(Throwable err){
00124             System.out.println(err.getMessage());
00125         }
00126 
00127 
00128         //      ++aindex;
00129         }
00130     }
00131 
00132     it = realParameterArrays.entrySet().iterator();
00133 
00134     while(it.hasNext()){
00135         Entry ient = (Entry)it.next();
00136         String name = (String)ient.getKey();
00137         HashMap<Integer, Double> jmap = 
00138         (HashMap<Integer, Double>)ient.getValue();
00139         Iterator jt = jmap.entrySet().iterator();
00140         //      aindex = 0;
00141         while(jt.hasNext()){
00142         ++id;
00143         Entry jent = (Entry)jt.next();
00144         names.add(name);
00145         ivalues.add(null);
00146         rvalues.add((Double)jent.getValue());
00147         Integer index = (Integer)jent.getKey();
00148         aindices.add(index);
00149         ids.add(id);
00150         try{
00151             relPhoton_.add(gen.getIsRelevantToPhoton(name, index));
00152             relProton_.add(gen.getIsRelevantToProton(name, index));
00153         }catch(Throwable err){
00154             System.out.println(err.getMessage());
00155         }
00156 
00157 
00158         //      ++aindex;
00159         }
00160     }
00161     return(this);
00162     }


Member Data Documentation

Vector<Integer> aindices = new Vector<Integer>() [private]
 

Definition at line 24 of file GeneratorWrapper.java.

Generator gen = null [private]
 

Definition at line 18 of file GeneratorWrapper.java.

Vector<Integer> ids = new Vector<Integer>() [private]
 

Definition at line 20 of file GeneratorWrapper.java.

Vector<Integer> ivalues = new Vector<Integer>() [private]
 

Definition at line 22 of file GeneratorWrapper.java.

Vector<String> names = new Vector<String>() [private]
 

Definition at line 21 of file GeneratorWrapper.java.

Vector<Boolean> relPhoton_ = new Vector<Boolean>() [private]
 

Definition at line 26 of file GeneratorWrapper.java.

Vector<Boolean> relProton_ = new Vector<Boolean>() [private]
 

Definition at line 27 of file GeneratorWrapper.java.

Vector<Double> rvalues = new Vector<Double>() [private]
 

Definition at line 23 of file GeneratorWrapper.java.


The documentation for this class was generated from the following file:

Generated Wed Jan 17 09:14:27 GMT 2007