Object[] setArg = null;
Class[] setArgClasses;
Class[] getArgClasses;
MethodStorage methodStor = null;
Object distributedStorageObj = this.transientStorage;
Class distributedStorageCls = distributedStorageObj.getClass();
Object localStorageObj = this;
Class localStorageCls = localStorageObj.getClass();
if (parts[0].equals("pH")) //pH...
{
getter = "getpH";
setter = "setpH";
String buffername = parts[1];
String expname = parts[2];
String tid = parts[3];
String obs = parts[4];
String input = "";
// System.out.println("buffername:"+buffername);
// System.out.println("expname:"+expname);
// System.out.println("tid:"+tid);
// System.out.println("obs:"+obs);
// System.out.println("input:"+input);
//
getArg = new Object[]{expname,tid,obs};
getArgClasses = new Class[]{String.class,String.class,String.class};
setArg = new Object[]{expname,tid,obs,input};
int replaceIndex = 3;
setArgClasses = new Class[]{String.class,String.class,String.class,String.class};
try
{
setMethod = distributedStorageCls.getMethod(setter,setArgClasses);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed setter method "+setter+" from class "+distributedStorageCls.toString()+".",err);
}
try
{
getMethod = distributedStorageCls.getMethod(getter,getArgClasses);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed getter method "+getter+" from class "+distributedStorageCls.toString()+".",err);
}
try
{
methodStor = new MethodStorage(getMethod,distributedStorageObj,getArg,setMethod,distributedStorageObj,setArg,replaceIndex);
methodStor.setPreSetConversionMethod(this.dblToStringMeth);
methodStor.setPostGetConversionMethod(this.stringToDblMeth);
}
catch (Exception err)
{
throw new RuntimeException("Problem creating distributed method for "+p+".",err);
}
}
else if (parts[0].equals("c")) //Titrant concentration...
{
getter = "getTitrantConcentration";
setter = "setTitrantConcentration";
String buffername = parts[1];
String expname = parts[2];
String tid = parts[3];
String obs = parts[4];
String input = "";
getArg = new Object[]{expname,tid,obs};
getArgClasses = new Class[]{String.class,String.class,String.class};
setArg = new Object[]{expname,tid,obs,input};
int replaceIndex = 3;
setArgClasses = new Class[]{String.class,String.class,String.class,String.class};
try
{
setMethod = distributedStorageCls.getMethod(setter,setArgClasses);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed setter method "+setter+".",err);
}
try
{
getMethod = distributedStorageCls.getMethod(getter,getArgClasses);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed getter method "+getter+".",err);
}
try
{
methodStor = new MethodStorage(getMethod,distributedStorageObj,getArg,setMethod,distributedStorageObj,setArg,replaceIndex);
methodStor.setPreSetConversionMethod(this.dblToStringMeth);
methodStor.setPostGetConversionMethod(this.stringToDblMeth);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed method "+setter+".",err);
}
// method = "getTitrantConcentration";
// String expname = parts[1];
// String tid = parts[2];
// String input = "";
//
// args = new Object[]{expname,tid};
// argClasses = new Class[]{expname.getClass(),tid.getClass()};
// try
// {
// methodStor = new MethodStorage(cls.getMethod(method,argClasses),this,args);
// }
// catch (Exception err)
// {
// throw new RuntimeException("Problem getting method "+method+".",err);
// }
//
// this.getterMethodMap.put(p,methodStor);
//
// args = new Object[]{expname,tid,input};
// try
// {
// methodStor = new MethodStorage(cls.getMethod(method,argClasses),this,args,2);
// }
// catch (Exception err)
// {
// throw new RuntimeException("Problem getting method "+method+".",err);
// }
//
// this.setterMethodMap.put(p,methodStor);
}
// else if (parts[0].equals("pKa")) //pKa
// {
//
// getter = "getSpecificpKa";
// setter = "setSpecificpKa";
//
// String buffername = parts[1];
// String expname = parts[2];
// String ssid = parts[3];
// //String ion = parts[4];
// //String group = parts[5];
//
//
// Integer ii = new Integer(parts[4]);
// int ion = ii.intValue();
// ii = new Integer(parts[5]);
// int jth = ii.intValue();
//
// DblMatrix input = new DblMatrix();
//
// getArg = new Object[]{expname,ssid,ion,jth};
//
// getArgClasses = new Class[]{String.class,String.class,int.class,int.class};
//
//
//
//
// setArg = new Object[]{expname,ssid,ion,jth,input};
// int replaceIndex = 4;
// setArgClasses = new Class[]{String.class,String.class,int.class,int.class,DblMatrix.class};
//
//
//
// try
// {
// setMethod = this.getClass().getMethod(setter,setArgClasses);
// }
// catch (Exception err)
// {
// throw new RuntimeException("Problem getting distributed setter method "+setter+".",err);
// }
//
// try
// {
// getMethod = this.getClass().getMethod(getter,getArgClasses);
// }
// catch (Exception err)
// {
// throw new RuntimeException("Problem getting distributed getter method "+getter+".",err);
// }
//
// try
// {
// methodStor = new MethodStorage(getMethod,this,getArg,setMethod,this,setArg,replaceIndex);
//
// }
// catch (Exception err)
// {
// throw new RuntimeException("Problem getting distributed method "+setter+".",err);
// }
//
// }
// else if (parts[0].equals("pKb"))//pKb
// {
// getter = "getSpecificpKb";
// setter = "setSpecificpKb";
//
// String buffername = parts[1];
// String expname = parts[2];
// String ssid = parts[3];
// //String ion = parts[4];
// //String group = parts[5];
//
//
// Integer ii = new Integer(parts[4]);
// int ion = ii.intValue();
// ii = new Integer(parts[5]);
// int jth = ii.intValue();
//
// DblMatrix input = new DblMatrix();
//
// getArg = new Object[]{expname,ssid,ion,jth};
//
// getArgClasses = new Class[]{String.class,String.class,int.class,int.class};
//
//
//
//
// setArg = new Object[]{expname,ssid,ion,jth,input};
// int replaceIndex = 4;
// setArgClasses = new Class[]{String.class,String.class,int.class,int.class,DblMatrix.class};
//
//
//
// try
// {
// setMethod = this.getClass().getMethod(setter,setArgClasses);
// }
// catch (Exception err)
// {
// throw new RuntimeException("Problem getting distributed setter method "+setter+".",err);
// }
//
// try
// {
// getMethod = this.getClass().getMethod(getter,getArgClasses);
// }
// catch (Exception err)
// {
// throw new RuntimeException("Problem getting distributed getter method "+getter+".",err);
// }
//
// try
// {
// methodStor = new MethodStorage(getMethod,this,getArg,setMethod,this,setArg,replaceIndex);
//
// }
// catch (Exception err)
// {
// throw new RuntimeException("Problem getting distributed method "+setter+".",err);
// }
//
// }
else if (parts[0].equals("v"))//aliquot volume
{
getter = "getVolumeAdded";
setter = "setVolumeAdded";
String buffername = parts[1];
String expname = parts[2];
String tid = parts[3];
String obs = parts[4];
String input = "";
getArg = new Object[]{expname,tid,obs};
getArgClasses = new Class[]{String.class,String.class,String.class};
setArg = new Object[]{expname,tid,obs,input};
int replaceIndex = 3;
setArgClasses = new Class[]{String.class,String.class,String.class,String.class};
try
{
setMethod = distributedStorageCls.getMethod(setter,setArgClasses);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed setter method "+setter+".",err);
}
try
{
getMethod = distributedStorageCls.getMethod(getter,getArgClasses);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed getter method "+getter+".",err);
}
try
{
methodStor = new MethodStorage(getMethod,distributedStorageObj,getArg,setMethod,distributedStorageObj,setArg,replaceIndex);
methodStor.setPreSetConversionMethod(this.dblToStringMeth);
methodStor.setPostGetConversionMethod(this.stringToDblMeth);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed method "+setter+".",err);
}
}
else if (parts[0].equals("Vo"))//Initial flask volume
{
getter = "getInitialVolume";
setter = "setInitialVolume";
String buffername = parts[1];
String expname = parts[2];
String tid = parts[3];
String input = "";
getArg = new Object[]{expname,tid};
getArgClasses = new Class[]{String.class,String.class};
setArg = new Object[]{expname,tid,input};
int replaceIndex = 2;
setArgClasses = new Class[]{String.class,String.class,String.class};
try
{
setMethod = distributedStorageCls.getMethod(setter,setArgClasses);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed setter method "+setter+".",err);
}
try
{
getMethod = distributedStorageCls.getMethod(getter,getArgClasses);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed getter method "+getter+".",err);
}
try
{
methodStor = new MethodStorage(getMethod,distributedStorageObj,getArg,setMethod,distributedStorageObj,setArg,replaceIndex);
methodStor.setPreSetConversionMethod(this.dblToStringMeth);
methodStor.setPostGetConversionMethod(this.stringToDblMeth);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed method "+setter+".",err);
}
}
else //Default... we'll just set the parameter in the super class' (StatisticalModel) DblParamSet.
{ //It's as good a place as any...
getter = "getParamSuper";
setter = "setParamSuper";
String paramName = p;
DblMatrix value = new DblMatrix(0);
getArg = new Object[]{paramName};
getArgClasses = new Class[]{String.class};
setArg = new Object[]{paramName,value};
int replaceIndex = 1;
setArgClasses = new Class[]{String.class,DblMatrix.class};
try
{
setMethod = localStorageCls.getMethod(setter,setArgClasses);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed setter method "+setter+".",err);
}
try
{
getMethod = localStorageCls.getMethod(getter,getArgClasses);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed getter method "+getter+".",err);
}
try
{
methodStor = new MethodStorage(getMethod,localStorageObj,getArg,setMethod,localStorageObj,setArg,replaceIndex);
}
catch (Exception err)
{
throw new RuntimeException("Problem getting distributed method "+setter+".",err);
}